Skip to content

Commit 6e5d8ae

Browse files
1 parent 91dc934 commit 6e5d8ae

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

source/includes/fundamentals/code-snippets/AggTour.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ public static void main(String[] args) {
2828
MongoCollection<Document> collection = database.getCollection("restaurants");
2929
// end connection
3030

31-
// begin insert
3231
collection.drop();
33-
32+
// begin insert
3433
collection.insertMany(Arrays.asList(
3534
new Document("name", "Sun Bakery Trattoria").append("contact", new Document().append("phone", "386-555-0189").append("email", "[email protected]").append("location", Arrays.asList(-74.0056649, 40.7452371))).append("stars", 4).append("categories", Arrays.asList("Pizza", "Pasta", "Italian", "Coffee", "Sandwiches")),
3635
new Document("name", "Blue Bagels Grill").append("contact", new Document().append("phone", "786-555-0102").append("email", "[email protected]").append("location", Arrays.asList(-73.92506, 40.8275556))).append("stars", 3).append("categories", Arrays.asList("Bagels", "Cookies", "Sandwiches")),

source/includes/fundamentals/code-snippets/builders/Projections.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ private void includeOneField() {
164164

165165
private void setupCollection() {
166166
System.out.println("setting up collection");
167+
collection.drop();
167168
// begin collection setup
168169
// The global average temperature, by month, from 2018 and 2019. Units are in
169170
// Celsius.
@@ -197,7 +198,6 @@ private void setupCollection() {
197198
new Document("month", "November").append("avg", 9.84),
198199
new Document("month", "December").append("avg", 10.366))));
199200

200-
collection.drop();
201201
collection.insertMany(demoDocuments);
202202
collection.createIndex(Indexes.text("type"));
203203
// end collection setup

0 commit comments

Comments
 (0)