MCPcopy
hub / github.com/mongodb/node-mongodb-native / apply

Method apply

src/write_concern.ts:118–126  ·  src/write_concern.ts::WriteConcern.apply

* Apply a write concern to a command document. Will modify and return the command.

(command: Document, writeConcern: WriteConcern)

Source from the content-addressed store, hash-verified

116 * Apply a write concern to a command document. Will modify and return the command.
117 */
118 static apply(command: Document, writeConcern: WriteConcern): Document {
119 const wc: CommandWriteConcernOptions = {};
120 class="cm">// The write concern document sent to the server has w/wtimeout/j fields.
121 if (writeConcern.w != null) wc.w = writeConcern.w;
122 if (writeConcern.wtimeoutMS != null) wc.wtimeout = writeConcern.wtimeoutMS;
123 if (writeConcern.journal != null) wc.j = writeConcern.j;
124 command.writeConcern = wc;
125 return command;
126 }
127
128 /** Construct a WriteConcern given an options object. */
129 static fromOptions(

Callers 15

jquery.jsFile · 0.80
seFunction · 0.80
CeFunction · 0.80
EeFunction · 0.80
IFunction · 0.80
cFunction · 0.80
eFunction · 0.80
FeFunction · 0.80
testOperationFunction · 0.80
providerFunction · 0.80

Calls

no outgoing calls

Tested by 3

providerFunction · 0.64
testFunction · 0.64