-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathBSON.html
56 lines (53 loc) · 60.9 KB
/
BSON.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BSON | 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="BSON.html">BSON</a></li></ul><h1>Namespace BSON</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><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-external"><section class="tsd-index-section"><h3>Classes BSONType</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONRegExp.html" class="tsd-kind-icon">BSONReg<wbr/>Exp</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONSymbol.html" class="tsd-kind-icon">BSONSymbol</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Binary.html" class="tsd-kind-icon">Binary</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Code.html" class="tsd-kind-icon">Code</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.DBRef.html" class="tsd-kind-icon">DBRef</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Decimal128.html" class="tsd-kind-icon">Decimal128</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Double.html" class="tsd-kind-icon">Double</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Int32.html" class="tsd-kind-icon">Int32</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Long.html" class="tsd-kind-icon">Long</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.MaxKey.html" class="tsd-kind-icon">Max<wbr/>Key</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.MinKey.html" class="tsd-kind-icon">Min<wbr/>Key</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.ObjectId.html" class="tsd-kind-icon">Object<wbr/>Id</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Timestamp.html" class="tsd-kind-icon">Timestamp</a></li></ul></section><section class="tsd-index-section"><h3>Classes Error</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONVersionError.html" class="tsd-kind-icon">BSONVersion<wbr/>Error</a></li></ul></section><section class="tsd-index-section"><h3>Classes Error
An error generated when BSON functions encounter an unexpected input
or reaches an unexpected/invalid internal state</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONRuntimeError.html" class="tsd-kind-icon">BSONRuntime<wbr/>Error</a></li></ul></section><section class="tsd-index-section"><h3>Classes Error
`BSONError` objects are thrown when BSON ecounters an error.
This is the parent class for all the other errors thrown by this library.</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONError.html" class="tsd-kind-icon">BSONError</a></li></ul></section><section class="tsd-index-section"><h3>Classes Other</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONValue.html" class="tsd-kind-icon">BSONValue</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.UUID.html" class="tsd-kind-icon">UUID</a></li></ul></section></section><section class="tsd-index-section tsd-is-external"><h3>Interfaces</h3><ul class="tsd-index-list"><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BSONRegExpExtended.html" class="tsd-kind-icon">BSONReg<wbr/>Exp<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BSONRegExpExtendedLegacy.html" class="tsd-kind-icon">BSONReg<wbr/>Exp<wbr/>Extended<wbr/>Legacy</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BSONSymbolExtended.html" class="tsd-kind-icon">BSONSymbol<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BinaryExtended.html" class="tsd-kind-icon">Binary<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BinaryExtendedLegacy.html" class="tsd-kind-icon">Binary<wbr/>Extended<wbr/>Legacy</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.CodeExtended.html" class="tsd-kind-icon">Code<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.DBRefLike.html" class="tsd-kind-icon">DBRef<wbr/>Like</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.Decimal128Extended.html" class="tsd-kind-icon">Decimal128<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.DeserializeOptions.html" class="tsd-kind-icon">Deserialize<wbr/>Options</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.Document.html" class="tsd-kind-icon">Document</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.DoubleExtended.html" class="tsd-kind-icon">Double<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.Int32Extended.html" class="tsd-kind-icon">Int32<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.LongExtended.html" class="tsd-kind-icon">Long<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.MaxKeyExtended.html" class="tsd-kind-icon">Max<wbr/>Key<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.MinKeyExtended.html" class="tsd-kind-icon">Min<wbr/>Key<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.ObjectIdExtended.html" class="tsd-kind-icon">Object<wbr/>Id<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.ObjectIdLike.html" class="tsd-kind-icon">Object<wbr/>Id<wbr/>Like</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.SerializeOptions.html" class="tsd-kind-icon">Serialize<wbr/>Options</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.TimestampExtended.html" class="tsd-kind-icon">Timestamp<wbr/>Extended</a></li></ul></section><section class="tsd-index-section tsd-is-external"><h3>Type aliases</h3><ul class="tsd-index-list"><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#BSONType" class="tsd-kind-icon">BSONType</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#BinarySequence" class="tsd-kind-icon">Binary<wbr/>Sequence</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#CalculateObjectSizeOptions" class="tsd-kind-icon">Calculate<wbr/>Object<wbr/>Size<wbr/>Options</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#EJSONOptions" class="tsd-kind-icon">EJSONOptions</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#LongWithoutOverrides" class="tsd-kind-icon">Long<wbr/>Without<wbr/>Overrides</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#TimestampOverrides" class="tsd-kind-icon">Timestamp<wbr/>Overrides</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#UUIDExtended" class="tsd-kind-icon">UUIDExtended</a></li></ul></section><section class="tsd-index-section tsd-is-external"><h3>Variables</h3><ul class="tsd-index-list"><li class="tsd-kind-variable tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#BSONType-1" class="tsd-kind-icon">BSONType</a></li><li class="tsd-kind-variable tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#EJSON" class="tsd-kind-icon">EJSON</a></li><li class="tsd-kind-variable tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#LongWithoutOverridesClass" class="tsd-kind-icon">Long<wbr/>Without<wbr/>Overrides<wbr/>Class</a></li></ul></section><section class="tsd-index-section tsd-is-external"><h3>Functions</h3><ul class="tsd-index-list"><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#calculateObjectSize" class="tsd-kind-icon">calculate<wbr/>Object<wbr/>Size</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#deserialize-1" class="tsd-kind-icon">deserialize</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#deserializeStream" class="tsd-kind-icon">deserialize<wbr/>Stream</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#serialize-1" class="tsd-kind-icon">serialize</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#serializeWithBufferAndIndex" class="tsd-kind-icon">serialize<wbr/>With<wbr/>Buffer<wbr/>And<wbr/>Index</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#setInternalBufferSize" class="tsd-kind-icon">set<wbr/>Internal<wbr/>Buffer<wbr/>Size</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-external"><h2>Type aliases</h2><section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a id="BSONType" class="tsd-anchor"></a><h3 class="tsd-anchor-link">BSONType<a href="#BSONType" 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">BSONType<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><a href="BSON.html" class="tsd-signature-type" data-tsd-kind="Namespace">BSON</a><span class="tsd-signature-symbol">.</span><a href="BSON.html#BSONType-1" class="tsd-signature-type" data-tsd-kind="Variable">BSONType</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">keyof </span><span class="tsd-signature-symbol">typeof </span><a href="BSON.html" class="tsd-signature-type" data-tsd-kind="Namespace">BSON</a><span class="tsd-signature-symbol">.</span><a href="BSON.html#BSONType-1" class="tsd-signature-type" data-tsd-kind="Variable">BSONType</a><span class="tsd-signature-symbol">]</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:283</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a id="BinarySequence" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Binary<wbr/>Sequence<a href="#BinarySequence" 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">Binary<wbr/>Sequence<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:100</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a id="CalculateObjectSizeOptions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Calculate<wbr/>Object<wbr/>Size<wbr/>Options<a href="#CalculateObjectSizeOptions" 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">Calculate<wbr/>Object<wbr/>Size<wbr/>Options<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Pick</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/BSON.SerializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SerializeOptions</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"serializeFunctions"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"ignoreUndefined"</span><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:313</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a id="EJSONOptions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">EJSONOptions<a href="#EJSONOptions" 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">EJSONOptions<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>legacy<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>relaxed<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>useBigInt64<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> }</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:524</li></ul></aside><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-flag ts-flagOptional">Optional</span> legacy<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Output using the Extended JSON v1 spec</p>
</div></div></li><li class="tsd-parameter"><h5><span class="tsd-flag ts-flagOptional">Optional</span> relaxed<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Enable Extended JSON's <code>relaxed</code> mode, which attempts to return native JS types where possible, rather than BSON types</p>
</div></div></li><li class="tsd-parameter"><h5><span class="tsd-flag ts-flagOptional">Optional</span> use<wbr/>Big<wbr/>Int64<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Enable native bigint support</p>
</div></div></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a id="LongWithoutOverrides" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Long<wbr/>Without<wbr/>Overrides<a href="#LongWithoutOverrides" 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">Long<wbr/>Without<wbr/>Overrides<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">new </span><span class="tsd-signature-symbol">(</span>low<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span>, high<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span>, unsigned<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[ </span><span class="tsd-signature-type">P</span><span class="tsd-signature-symbol"> in </span><span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">keyof </span><a href="../classes/BSON.Long.html" class="tsd-signature-type" data-tsd-kind="Class">Long</a><span class="tsd-signature-symbol">, </span><a href="BSON.html#TimestampOverrides" class="tsd-signature-type" data-tsd-kind="Type alias">TimestampOverrides</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">: </span><a href="../classes/BSON.Long.html" class="tsd-signature-type" data-tsd-kind="Class">Long</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">P</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:897</li></ul></aside><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-type-alias tsd-is-external"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">new </span><span class="tsd-signature-symbol">(</span>low<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">unknown</span>, high<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span>, unsigned<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[ </span><span class="tsd-signature-type">P</span><span class="tsd-signature-symbol"> in </span><span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">keyof </span><a href="../classes/BSON.Long.html" class="tsd-signature-type" data-tsd-kind="Class">Long</a><span class="tsd-signature-symbol">, </span><a href="BSON.html#TimestampOverrides" class="tsd-signature-type" data-tsd-kind="Type alias">TimestampOverrides</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">: </span><a href="../classes/BSON.Long.html" class="tsd-signature-type" data-tsd-kind="Class">Long</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">P</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">}</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>low: <span class="tsd-signature-type">unknown</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> high: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> unsigned: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[ </span><span class="tsd-signature-type">P</span><span class="tsd-signature-symbol"> in </span><span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">keyof </span><a href="../classes/BSON.Long.html" class="tsd-signature-type" data-tsd-kind="Class">Long</a><span class="tsd-signature-symbol">, </span><a href="BSON.html#TimestampOverrides" class="tsd-signature-type" data-tsd-kind="Type alias">TimestampOverrides</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">: </span><a href="../classes/BSON.Long.html" class="tsd-signature-type" data-tsd-kind="Class">Long</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">P</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">}</span></h4></li></ul></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a id="TimestampOverrides" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Timestamp<wbr/>Overrides<a href="#TimestampOverrides" 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">Timestamp<wbr/>Overrides<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"_bsontype"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"toExtendedJSON"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"fromExtendedJSON"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"inspect"</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:1164</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a id="UUIDExtended" class="tsd-anchor"></a><h3 class="tsd-anchor-link">UUIDExtended<a href="#UUIDExtended" 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">UUIDExtended<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>$uuid<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:1229</li></ul></aside><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5>$uuid<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li></ul></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-external"><h2>Variables</h2><section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-namespace tsd-is-external"><a id="BSONType-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> BSONType<a href="#BSONType-1" 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">BSONType<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span>array<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">4</span><span class="tsd-signature-symbol">; </span>binData<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">5</span><span class="tsd-signature-symbol">; </span>bool<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">8</span><span class="tsd-signature-symbol">; </span>date<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">9</span><span class="tsd-signature-symbol">; </span>dbPointer<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">12</span><span class="tsd-signature-symbol">; </span>decimal<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">19</span><span class="tsd-signature-symbol">; </span>double<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">1</span><span class="tsd-signature-symbol">; </span>int<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">16</span><span class="tsd-signature-symbol">; </span>javascript<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">13</span><span class="tsd-signature-symbol">; </span>javascriptWithScope<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">15</span><span class="tsd-signature-symbol">; </span>long<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">18</span><span class="tsd-signature-symbol">; </span>maxKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">127</span><span class="tsd-signature-symbol">; </span>minKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">-1</span><span class="tsd-signature-symbol">; </span>null<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">10</span><span class="tsd-signature-symbol">; </span>object<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">3</span><span class="tsd-signature-symbol">; </span>objectId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">7</span><span class="tsd-signature-symbol">; </span>regex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">11</span><span class="tsd-signature-symbol">; </span>string<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">2</span><span class="tsd-signature-symbol">; </span>symbol<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">14</span><span class="tsd-signature-symbol">; </span>timestamp<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">17</span><span class="tsd-signature-symbol">; </span>undefined<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">6</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:258</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-namespace tsd-is-external"><a id="EJSON" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> EJSON<a href="#EJSON" 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">EJSON<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>deserialize<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">EJSONdeserialize</span><span class="tsd-signature-symbol">; </span>parse<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">parse</span><span class="tsd-signature-symbol">; </span>serialize<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">EJSONserialize</span><span class="tsd-signature-symbol">; </span>stringify<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">stringify</span><span class="tsd-signature-symbol"> }</span></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:508</li></ul></aside><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5>deserialize<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">EJSONdeserialize</span></h5></li><li class="tsd-parameter"><h5>parse<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">parse</span></h5></li><li class="tsd-parameter"><h5>serialize<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">EJSONserialize</span></h5></li><li class="tsd-parameter"><h5>stringify<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">typeof </span><span class="tsd-signature-type">stringify</span></h5></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-namespace tsd-is-external"><a id="LongWithoutOverridesClass" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> Long<wbr/>Without<wbr/>Overrides<wbr/>Class<a href="#LongWithoutOverridesClass" 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">Long<wbr/>Without<wbr/>Overrides<wbr/>Class<span class="tsd-signature-symbol">:</span> <a href="BSON.html#LongWithoutOverrides" class="tsd-signature-type" data-tsd-kind="Type alias">LongWithoutOverrides</a></div><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:902</li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group tsd-is-external"><h2>Functions</h2><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a id="calculateObjectSize" class="tsd-anchor"></a><h3 class="tsd-anchor-link">calculate<wbr/>Object<wbr/>Size<a href="#calculateObjectSize" 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-function tsd-parent-kind-namespace tsd-is-external"><li class="tsd-signature tsd-kind-icon">calculate<wbr/>Object<wbr/>Size<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, options<span class="tsd-signature-symbol">?: </span><a href="BSON.html#CalculateObjectSizeOptions" class="tsd-signature-type" data-tsd-kind="Type alias">CalculateObjectSizeOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:310</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Calculate the bson size for a passed in Javascript object.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>object: <a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the Javascript object to calculate the BSON byte size for</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="BSON.html#CalculateObjectSizeOptions" class="tsd-signature-type" data-tsd-kind="Type alias">CalculateObjectSizeOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div><p>size of BSON object in bytes</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a id="deserialize-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link">deserialize<a href="#deserialize-1" 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-function tsd-parent-kind-namespace tsd-is-external"><li class="tsd-signature tsd-kind-icon">deserialize<span class="tsd-signature-symbol">(</span>buffer<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Uint8Array</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/BSON.DeserializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DeserializeOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:415</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Deserialize data as BSON.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>buffer: <span class="tsd-signature-type">Uint8Array</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the buffer containing the serialized set of BSON documents.</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/BSON.DeserializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DeserializeOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h4><div><p>returns the deserialized Javascript Object.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a id="deserializeStream" class="tsd-anchor"></a><h3 class="tsd-anchor-link">deserialize<wbr/>Stream<a href="#deserializeStream" 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-function tsd-parent-kind-namespace tsd-is-external"><li class="tsd-signature tsd-kind-icon">deserialize<wbr/>Stream<span class="tsd-signature-symbol">(</span>data<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span>, startIndex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, numberOfDocuments<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, documents<span class="tsd-signature-symbol">: </span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">[]</span>, docStartIndex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, options<span class="tsd-signature-symbol">: </span><a href="../interfaces/BSON.DeserializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DeserializeOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:468</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Deserialize stream data as BSON documents.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>data: <span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ArrayBuffer</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the buffer containing the serialized set of BSON documents.</p>
</div></div></li><li><h5>startIndex: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the start index in the data Buffer where the deserialization is to start.</p>
</div></div></li><li><h5>numberOfDocuments: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>number of documents to deserialize.</p>
</div></div></li><li><h5>documents: <a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>an array where to store the deserialized documents.</p>
</div></div></li><li><h5>docStartIndex: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the index in the documents array from where to start inserting documents.</p>
</div></div></li><li><h5>options: <a href="../interfaces/BSON.DeserializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">DeserializeOptions</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>additional options used for the deserialization.</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div><p>next index in the buffer after deserialization <strong>x</strong> numbers of documents.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a id="serialize-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link">serialize<a href="#serialize-1" 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-function tsd-parent-kind-namespace tsd-is-external"><li class="tsd-signature tsd-kind-icon">serialize<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/BSON.SerializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SerializeOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Uint8Array</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:1048</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Serialize a Javascript object.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>object: <a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the Javascript object to serialize.</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/BSON.SerializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SerializeOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Uint8Array</span></h4><div><p>Buffer object containing the serialized object.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a id="serializeWithBufferAndIndex" class="tsd-anchor"></a><h3 class="tsd-anchor-link">serialize<wbr/>With<wbr/>Buffer<wbr/>And<wbr/>Index<a href="#serializeWithBufferAndIndex" 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-function tsd-parent-kind-namespace tsd-is-external"><li class="tsd-signature tsd-kind-icon">serialize<wbr/>With<wbr/>Buffer<wbr/>And<wbr/>Index<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a>, finalBuffer<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Uint8Array</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/BSON.SerializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SerializeOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:1072</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Serialize a Javascript object using a predefined Buffer and index into the buffer,
useful when pre-allocating the space for serialization.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>object: <a href="../interfaces/BSON.Document.html" class="tsd-signature-type" data-tsd-kind="Interface">Document</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the Javascript object to serialize.</p>
</div></div></li><li><h5>finalBuffer: <span class="tsd-signature-type">Uint8Array</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>the Buffer you pre-allocated to store the serialized BSON object.</p>
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/BSON.SerializeOptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SerializeOptions</a></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div><p>the index pointing to the last written byte in the buffer.</p>
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a id="setInternalBufferSize" class="tsd-anchor"></a><h3 class="tsd-anchor-link">set<wbr/>Internal<wbr/>Buffer<wbr/>Size<a href="#setInternalBufferSize" 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-function tsd-parent-kind-namespace tsd-is-external"><li class="tsd-signature tsd-kind-icon">set<wbr/>Internal<wbr/>Buffer<wbr/>Size<span class="tsd-signature-symbol">(</span>size<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in node_modules/bson/bson.d.ts:1080</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
<p>Sets the size of the internal serialization buffer.</p>
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>size: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>The desired size for the internal serialization buffer</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></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><li class="label tsd-is-external"><span>Internals</span></li><li class="label tsd-is-external"><span>Externals</span></li><li class="current tsd-kind-namespace tsd-is-external"><a href="BSON.html">BSON</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONError.html" class="tsd-kind-icon">BSONError</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONRegExp.html" class="tsd-kind-icon">BSONReg<wbr/>Exp</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONRuntimeError.html" class="tsd-kind-icon">BSONRuntime<wbr/>Error</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONSymbol.html" class="tsd-kind-icon">BSONSymbol</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONValue.html" class="tsd-kind-icon">BSONValue</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.BSONVersionError.html" class="tsd-kind-icon">BSONVersion<wbr/>Error</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Binary.html" class="tsd-kind-icon">Binary</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Code.html" class="tsd-kind-icon">Code</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.DBRef.html" class="tsd-kind-icon">DBRef</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Decimal128.html" class="tsd-kind-icon">Decimal128</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Double.html" class="tsd-kind-icon">Double</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Int32.html" class="tsd-kind-icon">Int32</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Long.html" class="tsd-kind-icon">Long</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.MaxKey.html" class="tsd-kind-icon">Max<wbr/>Key</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.MinKey.html" class="tsd-kind-icon">Min<wbr/>Key</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.ObjectId.html" class="tsd-kind-icon">Object<wbr/>Id</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.Timestamp.html" class="tsd-kind-icon">Timestamp</a></li><li class="tsd-kind-class tsd-parent-kind-namespace tsd-is-external"><a href="../classes/BSON.UUID.html" class="tsd-kind-icon">UUID</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BSONRegExpExtended.html" class="tsd-kind-icon">BSONReg<wbr/>Exp<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BSONRegExpExtendedLegacy.html" class="tsd-kind-icon">BSONReg<wbr/>Exp<wbr/>Extended<wbr/>Legacy</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BSONSymbolExtended.html" class="tsd-kind-icon">BSONSymbol<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BinaryExtended.html" class="tsd-kind-icon">Binary<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.BinaryExtendedLegacy.html" class="tsd-kind-icon">Binary<wbr/>Extended<wbr/>Legacy</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.CodeExtended.html" class="tsd-kind-icon">Code<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.DBRefLike.html" class="tsd-kind-icon">DBRef<wbr/>Like</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.Decimal128Extended.html" class="tsd-kind-icon">Decimal128<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.DeserializeOptions.html" class="tsd-kind-icon">Deserialize<wbr/>Options</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.Document.html" class="tsd-kind-icon">Document</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.DoubleExtended.html" class="tsd-kind-icon">Double<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.Int32Extended.html" class="tsd-kind-icon">Int32<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.LongExtended.html" class="tsd-kind-icon">Long<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.MaxKeyExtended.html" class="tsd-kind-icon">Max<wbr/>Key<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.MinKeyExtended.html" class="tsd-kind-icon">Min<wbr/>Key<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.ObjectIdExtended.html" class="tsd-kind-icon">Object<wbr/>Id<wbr/>Extended</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.ObjectIdLike.html" class="tsd-kind-icon">Object<wbr/>Id<wbr/>Like</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.SerializeOptions.html" class="tsd-kind-icon">Serialize<wbr/>Options</a></li><li class="tsd-kind-interface tsd-parent-kind-namespace tsd-is-external"><a href="../interfaces/BSON.TimestampExtended.html" class="tsd-kind-icon">Timestamp<wbr/>Extended</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#BSONType" class="tsd-kind-icon">BSONType</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#BinarySequence" class="tsd-kind-icon">Binary<wbr/>Sequence</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#CalculateObjectSizeOptions" class="tsd-kind-icon">Calculate<wbr/>Object<wbr/>Size<wbr/>Options</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#EJSONOptions" class="tsd-kind-icon">EJSONOptions</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#LongWithoutOverrides" class="tsd-kind-icon">Long<wbr/>Without<wbr/>Overrides</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#TimestampOverrides" class="tsd-kind-icon">Timestamp<wbr/>Overrides</a></li><li class="tsd-kind-type-alias tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#UUIDExtended" class="tsd-kind-icon">UUIDExtended</a></li><li class="tsd-kind-variable tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#BSONType-1" class="tsd-kind-icon">BSONType</a></li><li class="tsd-kind-variable tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#EJSON" class="tsd-kind-icon">EJSON</a></li><li class="tsd-kind-variable tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#LongWithoutOverridesClass" class="tsd-kind-icon">Long<wbr/>Without<wbr/>Overrides<wbr/>Class</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#calculateObjectSize" class="tsd-kind-icon">calculate<wbr/>Object<wbr/>Size</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#deserialize-1" class="tsd-kind-icon">deserialize</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#deserializeStream" class="tsd-kind-icon">deserialize<wbr/>Stream</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#serialize-1" class="tsd-kind-icon">serialize</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#serializeWithBufferAndIndex" class="tsd-kind-icon">serialize<wbr/>With<wbr/>Buffer<wbr/>And<wbr/>Index</a></li><li class="tsd-kind-function tsd-parent-kind-namespace tsd-is-external"><a href="BSON.html#setInternalBufferSize" class="tsd-kind-icon">set<wbr/>Internal<wbr/>Buffer<wbr/>Size</a></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><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</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>