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

Function decorateWithReadConcern

src/utils.ts:201–217  ·  view source on GitHub ↗
(
  command: Document,
  coll: { s: { readConcern?: ReadConcern } },
  options?: OperationOptions
)

Source from the content-addressed store, hash-verified

199 * @param coll - the parent collection of the operation calling this method
200 */
201export function decorateWithReadConcern(
202 command: Document,
203 coll: { s: { readConcern?: ReadConcern } },
204 options?: OperationOptions
205): void {
206 if (options && options.session && options.session.inTransaction()) {
207 return;
208 }
209 const readConcern = Object.assign({}, command.readConcern || {});
210 if (coll.s.readConcern) {
211 Object.assign(readConcern, coll.s.readConcern);
212 }
213
214 if (Object.keys(readConcern).length > 0) {
215 Object.assign(command, { readConcern: readConcern });
216 }
217}
218
219/**
220 * @internal

Callers

nothing calls this directly

Calls 1

inTransactionMethod · 0.80

Tested by

no test coverage detected