-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathOrderedBulkOperation.html
15 lines (15 loc) · 40.6 KB
/
OrderedBulkOperation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>OrderedBulkOperation | mongodb</title><meta name="description" content="Documentation for mongodb"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">mongodb</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">mongodb</a></li><li><a href="OrderedBulkOperation.html">OrderedBulkOperation</a></li></ul><h1>Class OrderedBulkOperation</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="BulkOperationBase.html" class="tsd-signature-type" data-tsd-kind="Class">BulkOperationBase</a><ul class="tsd-hierarchy"><li><span class="target">OrderedBulkOperation</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#isOrdered" class="tsd-kind-icon">is<wbr/>Ordered</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#operationId" class="tsd-kind-icon">operation<wbr/>Id</a></li></ul></section><section class="tsd-index-section tsd-is-inherited"><h3>Accessors</h3><ul class="tsd-index-list"><li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#batches" class="tsd-kind-icon">batches</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#bsonOptions" class="tsd-kind-icon">bson<wbr/>Options</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#writeConcern" class="tsd-kind-icon">write<wbr/>Concern</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class tsd-is-overwrite"><a href="OrderedBulkOperation.html#addToOperationsList" class="tsd-kind-icon">add<wbr/>To<wbr/>Operations<wbr/>List</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#execute" class="tsd-kind-icon">execute</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#find" class="tsd-kind-icon">find</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#insert" class="tsd-kind-icon">insert</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#raw" class="tsd-kind-icon">raw</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="isOrdered" class="tsd-anchor"></a><h3 class="tsd-anchor-link">is<wbr/>Ordered<a href="#isOrdered" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">is<wbr/>Ordered<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><aside class="tsd-sources"><p>Inherited from <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#isOrdered">isOrdered</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L966">src/bulk/common.ts:966</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="operationId" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagOptional">Optional</span> operation<wbr/>Id<a href="#operationId" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">operation<wbr/>Id<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#operationId">operationId</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L969">src/bulk/common.ts:969</a></li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Accessors</h2><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a id="batches" class="tsd-anchor"></a><h3 class="tsd-anchor-link">batches<a href="#batches" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> batches<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Batch.html" class="tsd-signature-type" data-tsd-kind="Class">Batch</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from BulkOperationBase.batches</p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1247">src/bulk/common.ts:1247</a></li></ul></aside><h4 class="tsd-returns-title">Returns <a href="Batch.html" class="tsd-signature-type" data-tsd-kind="Class">Batch</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a id="bsonOptions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">bson<wbr/>Options<a href="#bsonOptions" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> bsonOptions<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/BSONSerializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BSONSerializeOptions</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from BulkOperationBase.bsonOptions</p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1239">src/bulk/common.ts:1239</a></li></ul></aside><h4 class="tsd-returns-title">Returns <a href="../interfaces/BSONSerializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BSONSerializeOptions</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a id="writeConcern" class="tsd-anchor"></a><h3 class="tsd-anchor-link">write<wbr/>Concern<a href="#writeConcern" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> writeConcern<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="WriteConcern.html" class="tsd-signature-type" data-tsd-kind="Class">WriteConcern</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from BulkOperationBase.writeConcern</p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1243">src/bulk/common.ts:1243</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="WriteConcern.html" class="tsd-signature-type" data-tsd-kind="Class">WriteConcern</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-overwrite"><a id="addToOperationsList" class="tsd-anchor"></a><h3 class="tsd-anchor-link">add<wbr/>To<wbr/>Operations<wbr/>List<a href="#addToOperationsList" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-overwrite"><li class="tsd-signature tsd-kind-icon">add<wbr/>To<wbr/>Operations<wbr/>List<span class="tsd-signature-symbol">(</span>batchType<span class="tsd-signature-symbol">: </span><a href="../modules.html#BatchType" class="tsd-signature-type" data-tsd-kind="Variable">BatchType</a>, document<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/DeleteStatement.html" class="tsd-signature-type" data-tsd-kind="Interface">DeleteStatement</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/UpdateStatement.html" class="tsd-signature-type" data-tsd-kind="Interface">UpdateStatement</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="OrderedBulkOperation.html" class="tsd-signature-type" data-tsd-kind="Class">OrderedBulkOperation</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Overrides <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#addToOperationsList">addToOperationsList</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/ordered.ts#L16">src/bulk/ordered.ts:16</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>batchType: <a href="../modules.html#BatchType" class="tsd-signature-type" data-tsd-kind="Variable">BatchType</a></h5></li><li><h5>document: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/DeleteStatement.html" class="tsd-signature-type" data-tsd-kind="Interface">DeleteStatement</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/UpdateStatement.html" class="tsd-signature-type" data-tsd-kind="Interface">UpdateStatement</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="OrderedBulkOperation.html" class="tsd-signature-type" data-tsd-kind="Class">OrderedBulkOperation</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="execute" class="tsd-anchor"></a><h3 class="tsd-anchor-link">execute<a href="#execute" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">execute<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/BulkWriteOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BulkWriteOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span></li><li class="tsd-signature tsd-kind-icon">execute<span class="tsd-signature-symbol">(</span>callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-signature tsd-kind-icon">execute<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/BulkWriteOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BulkWriteOptions</a>, callback<span class="tsd-signature-symbol">: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-signature tsd-kind-icon">execute<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/BulkWriteOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BulkWriteOptions</a><span class="tsd-signature-symbol"> | </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span>, callback<span class="tsd-signature-symbol">?: </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#execute">execute</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1259">src/bulk/common.ts:1259</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/BulkWriteOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BulkWriteOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#execute">execute</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1261">src/bulk/common.ts:1261</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#execute">execute</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1263">src/bulk/common.ts:1263</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>options: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/BulkWriteOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BulkWriteOptions</a></h5></li><li><h5>callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#execute">execute</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1265">src/bulk/common.ts:1265</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>deprecated</dt><dd><p>Callbacks are deprecated and will be removed in the next major version. See <a href="https://github.com/mongodb-js/nodejs-mongodb-legacy">mongodb-legacy</a> for migration assistance</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/BulkWriteOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">BulkWriteOptions</a><span class="tsd-signature-symbol"> | </span><a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> callback: <a href="../modules.html#Callback" class="tsd-signature-type" data-tsd-kind="Type alias">Callback</a><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="BulkWriteResult.html" class="tsd-signature-type" data-tsd-kind="Class">BulkWriteResult</a><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="find" class="tsd-anchor"></a><h3 class="tsd-anchor-link">find<a href="#find" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">find<span class="tsd-signature-symbol">(</span>selector<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="FindOperators.html" class="tsd-signature-type" data-tsd-kind="Class">FindOperators</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#find">find</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1132">src/bulk/common.ts:1132</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne.
Returns a builder object used to complete the definition of the operation.</p>
</div><dl class="tsd-comment-tags"><dt>example</dt><dd><pre><code class="language-ts"><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">bulkOp</span><span class="hl-0"> = </span><span class="hl-6">collection</span><span class="hl-0">.</span><span class="hl-2">initializeOrderedBulkOp</span><span class="hl-0">();</span><br/><br/><span class="hl-1">// Add an updateOne to the bulkOp</span><br/><span class="hl-6">bulkOp</span><span class="hl-0">.</span><span class="hl-2">find</span><span class="hl-0">({ </span><span class="hl-6">a:</span><span class="hl-0"> </span><span class="hl-8">1</span><span class="hl-0"> }).</span><span class="hl-2">updateOne</span><span class="hl-0">({ </span><span class="hl-6">$set:</span><span class="hl-0"> { </span><span class="hl-6">b:</span><span class="hl-0"> </span><span class="hl-8">2</span><span class="hl-0"> } });</span><br/><br/><span class="hl-1">// Add an updateMany to the bulkOp</span><br/><span class="hl-6">bulkOp</span><span class="hl-0">.</span><span class="hl-2">find</span><span class="hl-0">({ </span><span class="hl-6">c:</span><span class="hl-0"> </span><span class="hl-8">3</span><span class="hl-0"> }).</span><span class="hl-2">update</span><span class="hl-0">({ </span><span class="hl-6">$set:</span><span class="hl-0"> { </span><span class="hl-6">d:</span><span class="hl-0"> </span><span class="hl-8">4</span><span class="hl-0"> } });</span><br/><br/><span class="hl-1">// Add an upsert</span><br/><span class="hl-6">bulkOp</span><span class="hl-0">.</span><span class="hl-2">find</span><span class="hl-0">({ </span><span class="hl-6">e:</span><span class="hl-0"> </span><span class="hl-8">5</span><span class="hl-0"> }).</span><span class="hl-2">upsert</span><span class="hl-0">().</span><span class="hl-2">updateOne</span><span class="hl-0">({ </span><span class="hl-6">$set:</span><span class="hl-0"> { </span><span class="hl-6">f:</span><span class="hl-0"> </span><span class="hl-8">6</span><span class="hl-0"> } });</span><br/><br/><span class="hl-1">// Add a deletion</span><br/><span class="hl-6">bulkOp</span><span class="hl-0">.</span><span class="hl-2">find</span><span class="hl-0">({ </span><span class="hl-6">g:</span><span class="hl-0"> </span><span class="hl-8">7</span><span class="hl-0"> }).</span><span class="hl-2">deleteOne</span><span class="hl-0">();</span><br/><br/><span class="hl-1">// Add a multi deletion</span><br/><span class="hl-6">bulkOp</span><span class="hl-0">.</span><span class="hl-2">find</span><span class="hl-0">({ </span><span class="hl-6">h:</span><span class="hl-0"> </span><span class="hl-8">8</span><span class="hl-0"> }).</span><span class="hl-2">delete</span><span class="hl-0">();</span><br/><br/><span class="hl-1">// Add a replaceOne</span><br/><span class="hl-6">bulkOp</span><span class="hl-0">.</span><span class="hl-2">find</span><span class="hl-0">({ </span><span class="hl-6">i:</span><span class="hl-0"> </span><span class="hl-8">9</span><span class="hl-0"> }).</span><span class="hl-2">replaceOne</span><span class="hl-0">({</span><span class="hl-6">writeConcern:</span><span class="hl-0"> { </span><span class="hl-6">j:</span><span class="hl-0"> </span><span class="hl-8">10</span><span class="hl-0"> }});</span><br/><br/><span class="hl-1">// Update using a pipeline (requires Mongodb 4.2 or higher)</span><br/><span class="hl-6">bulk</span><span class="hl-0">.</span><span class="hl-2">find</span><span class="hl-0">({ </span><span class="hl-6">k:</span><span class="hl-0"> </span><span class="hl-8">11</span><span class="hl-0">, </span><span class="hl-6">y:</span><span class="hl-0"> { </span><span class="hl-6">$exists:</span><span class="hl-0"> </span><span class="hl-3">true</span><span class="hl-0"> }, </span><span class="hl-6">z:</span><span class="hl-0"> { </span><span class="hl-6">$exists:</span><span class="hl-0"> </span><span class="hl-3">true</span><span class="hl-0"> } }).</span><span class="hl-2">updateOne</span><span class="hl-0">([</span><br/><span class="hl-0"> { </span><span class="hl-6">$set:</span><span class="hl-0"> { </span><span class="hl-6">total:</span><span class="hl-0"> { </span><span class="hl-6">$sum:</span><span class="hl-0"> [ </span><span class="hl-5">'$y'</span><span class="hl-0">, </span><span class="hl-5">'$z'</span><span class="hl-0"> ] } } }</span><br/><span class="hl-0">]);</span><br/><br/><span class="hl-1">// All of the ops will now be executed</span><br/><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">bulkOp</span><span class="hl-0">.</span><span class="hl-2">execute</span><span class="hl-0">();</span>
</code></pre>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>selector: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="FindOperators.html" class="tsd-signature-type" data-tsd-kind="Class">FindOperators</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="insert" class="tsd-anchor"></a><h3 class="tsd-anchor-link">insert<a href="#insert" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">insert<span class="tsd-signature-symbol">(</span>document<span class="tsd-signature-symbol">: </span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="BulkOperationBase.html" class="tsd-signature-type" data-tsd-kind="Class">BulkOperationBase</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#insert">insert</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1089">src/bulk/common.ts:1089</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Add a single insert document to the bulk operation</p>
</div><dl class="tsd-comment-tags"><dt>example</dt><dd><pre><code class="language-ts"><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-4">bulkOp</span><span class="hl-0"> = </span><span class="hl-6">collection</span><span class="hl-0">.</span><span class="hl-2">initializeOrderedBulkOp</span><span class="hl-0">();</span><br/><br/><span class="hl-1">// Adds three inserts to the bulkOp.</span><br/><span class="hl-6">bulkOp</span><br/><span class="hl-0"> .</span><span class="hl-2">insert</span><span class="hl-0">({ </span><span class="hl-6">a:</span><span class="hl-0"> </span><span class="hl-8">1</span><span class="hl-0"> })</span><br/><span class="hl-0"> .</span><span class="hl-2">insert</span><span class="hl-0">({ </span><span class="hl-6">b:</span><span class="hl-0"> </span><span class="hl-8">2</span><span class="hl-0"> })</span><br/><span class="hl-0"> .</span><span class="hl-2">insert</span><span class="hl-0">({ </span><span class="hl-6">c:</span><span class="hl-0"> </span><span class="hl-8">3</span><span class="hl-0"> });</span><br/><span class="hl-7">await</span><span class="hl-0"> </span><span class="hl-6">bulkOp</span><span class="hl-0">.</span><span class="hl-2">execute</span><span class="hl-0">();</span>
</code></pre>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>document: <a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="BulkOperationBase.html" class="tsd-signature-type" data-tsd-kind="Class">BulkOperationBase</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="raw" class="tsd-anchor"></a><h3 class="tsd-anchor-link">raw<a href="#raw" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">raw<span class="tsd-signature-symbol">(</span>op<span class="tsd-signature-symbol">: </span><a href="../modules.html#AnyBulkWriteOperation" class="tsd-signature-type" data-tsd-kind="Type alias">AnyBulkWriteOperation</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="OrderedBulkOperation.html" class="tsd-signature-type" data-tsd-kind="Class">OrderedBulkOperation</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="BulkOperationBase.html">BulkOperationBase</a>.<a href="BulkOperationBase.html#raw">raw</a></p><ul><li>Defined in <a href="https://github.com/mongodb/node-mongodb-native/blob/v4.10.0/src/bulk/common.ts#L1146">src/bulk/common.ts:1146</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Specifies a raw operation to perform in the bulk write.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>op: <a href="../modules.html#AnyBulkWriteOperation" class="tsd-signature-type" data-tsd-kind="Type alias">AnyBulkWriteOperation</a><span class="tsd-signature-symbol"><</span><a href="../interfaces/Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="OrderedBulkOperation.html" class="tsd-signature-type" data-tsd-kind="Class">OrderedBulkOperation</a></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="OrderedBulkOperation.html" class="tsd-kind-icon">Ordered<wbr/>Bulk<wbr/>Operation</a><ul><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#isOrdered" class="tsd-kind-icon">is<wbr/>Ordered</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#operationId" class="tsd-kind-icon">operation<wbr/>Id</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#batches" class="tsd-kind-icon">batches</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#bsonOptions" class="tsd-kind-icon">bson<wbr/>Options</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#writeConcern" class="tsd-kind-icon">write<wbr/>Concern</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-overwrite"><a href="OrderedBulkOperation.html#addToOperationsList" class="tsd-kind-icon">add<wbr/>To<wbr/>Operations<wbr/>List</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#execute" class="tsd-kind-icon">execute</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#find" class="tsd-kind-icon">find</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#insert" class="tsd-kind-icon">insert</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="OrderedBulkOperation.html#raw" class="tsd-kind-icon">raw</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li><li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>