You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collections in MongoDB are created automatically simply by inserted a document into it. Using the `[createCollection]({{< apiref "com/mongodb/async/client/MongoDatabase.html#createCollection-java.lang.String-com.mongodb.async.SingleResultCallback-">}})` method, you can also create a collection explicitly in order to to customize its configuration. For example, to create a capped collection sized to 1 megabyte:
83
+
Collections in MongoDB are created automatically simply by inserted a document into it. Using the
method, you can also create a collection explicitly in order to to customize its configuration. For example, to create a capped collection sized to 1 megabyte:
Sometimes we don't need all the data contained in a document, the[Projections]({{< apiref "com/mongodb/client/model/Projections">}}) helpers help build the projection parameter for the
334
-
find operation. Below we'll sort the collection, exclude the `_id` field and output the first
335
-
matching document:
333
+
Sometimes we don't need all the data contained in a document. The[Projections]({{< apiref "com/mongodb/client/model/Projections">}})
334
+
helpers can be used to build the projection parameter for the find operation and limit the fields returned.
335
+
Below we'll sort the collection, exclude the `_id` field and output the first matching document:
@@ -370,7 +370,7 @@ collection.updateMany(lt("i", 100), new Document("$inc", new Document("i", 100))
370
370
});
371
371
```
372
372
373
-
The update methods return a[`UpdateResult`]({{< apiref "com/mongodb/client/result/UpdateResult.html">}})
373
+
The update methods return an[`UpdateResult`]({{< apiref "com/mongodb/client/result/UpdateResult.html">}}),
374
374
which provides information about the operation including the number of documents modified by the update.
375
375
376
376
## Deleting documents
@@ -387,8 +387,9 @@ collection.deleteOne(eq("i", 110), new SingleResultCallback<DeleteResult>() {
387
387
});
388
388
```
389
389
390
-
To delete all documents matching the filter use the [`deleteMany`]({{< apiref "com/mongodb/async/client/MongoCollection.html#deleteMany-org.bson.conversions.Bson-">}}) method.
391
-
Here we delete all documents where `i` is greater or equal to `100`:
390
+
To delete all documents matching the filter use the
391
+
[`deleteMany`]({{< apiref "com/mongodb/async/client/MongoCollection.html#deleteMany-org.bson.conversions.Bson-">}}) method. Here we delete
392
+
all documents where `i` is greater or equal to `100`:
Collections in MongoDB are created automatically simply by inserted a document into it. Using the `[createCollection]({{< apiref "com/mongodb/client/MongoDatabase.html#createCollection-java.lang.String-">}})` method, you can also create a collection explicitly in order to to customize its configuration. For example, to create a capped collection sized to 1 megabyte:
64
+
Collections in MongoDB are created automatically simply by inserted a document into it. Using the [`createCollection`]({{< apiref "com/mongodb/client/MongoDatabase.html#createCollection-java.lang.String-">}})
65
+
method, you can also create a collection explicitly in order to to customize its configuration. For example, to create a capped collection sized to 1 megabyte:
0 commit comments