@@ -86,7 +86,7 @@ cluster and use it across your application. When creating multiple instances:
86
86
## Get a Collection
87
87
88
88
To get a collection to operate upon, specify the name of the collection to
89
- the [ ` getCollection(String collectionName) ` ] ({{< apiref "com/mongodb/client/MongoDatabase.html#getCollection-java.lang.String-">}})
89
+ the [ ` getCollection(String collectionName) ` ] ({{< apiref "com/mongodb/async/ client/MongoDatabase.html#getCollection-java.lang.String-">}})
90
90
method:
91
91
92
92
The following example gets the collection ` test ` :
@@ -181,7 +181,7 @@ collection.insertMany(documents, new SingleResultCallback<Void>() {
181
181
182
182
Now that we've inserted 101 documents (the 100 we did in the loop, plus
183
183
the first one), we can check to see if we have them all using the
184
- [ count()] ({{< apiref "com/mongodb/client/MongoCollection#count--">}})
184
+ [ count()] ({{< apiref "com/mongodb/async/ client/MongoCollection#count--">}})
185
185
method. The following code should print ` 101 ` .
186
186
187
187
``` java
@@ -197,16 +197,16 @@ collection.count(
197
197
## Query the Collection
198
198
199
199
Use the
200
- [ find()] ({{< apiref "com/mongodb/client/MongoCollection.html#find--">}})
200
+ [ find()] ({{< apiref "com/mongodb/async/ client/MongoCollection.html#find--">}})
201
201
method to query the collection.
202
202
203
203
### Find the First Document in a Collection
204
204
205
205
call the first() method on the result of the find() of method
206
206
207
207
To get the first document in the collection, call the
208
- [ first()] ({{< apiref "com/mongodb/client/MongoIterable.html#first--">}})
209
- method on the [ find()] ({{< apiref "com/mongodb/client/MongoCollection.html#find--">}})
208
+ [ first()] ({{< apiref "com/mongodb/async/ client/MongoIterable.html#first--">}})
209
+ method on the [ find()] ({{< apiref "com/mongodb/async/ client/MongoCollection.html#find--">}})
210
210
operation. ` collection.find().first() ` returns the first document or null rather than a cursor.
211
211
This is useful for queries that should only match a single document, or if you are
212
212
interested in the first document only.
0 commit comments