- Reference >
mongo
Shell Methods >- Bulk Operation Methods >
- Bulk.tojson()
Bulk.tojson()¶
On this page
-
Bulk.
tojson
()¶ Returns a JSON document that contains the number of operations and batches in the
Bulk()
object.
Example¶
The following initializes a Bulk()
operations builder on the
items
collection, adds a series of write operations, and calls
Bulk.tojson()
on the bulk
builder object.
The Bulk.tojson()
returns the following JSON document
{ “nInsertOps” : 2, “nUpdateOps” : 0, “nRemoveOps” : 1, “nBatches” : 2 }
See also