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

Function attachServerSelectionFields

src/mongo_logger.ts:614–626  ·  view source on GitHub ↗
(
  log: Record<string, any>,
  serverSelectionEvent: ServerSelectionEvent,
  maxDocumentLength: number = DEFAULT_MAX_DOCUMENT_LENGTH
)

Source from the content-addressed store, hash-verified

612}
613
614function attachServerSelectionFields(
615 log: Record<string, any>,
616 serverSelectionEvent: ServerSelectionEvent,
617 maxDocumentLength: number = DEFAULT_MAX_DOCUMENT_LENGTH
618) {
619 const { selector, operation, topologyDescription, message } = serverSelectionEvent;
620 log.selector = stringifyWithMaxLen(selector, maxDocumentLength);
621 log.operation = operation;
622 log.topologyDescription = stringifyWithMaxLen(topologyDescription, maxDocumentLength);
623 log.message = message;
624
625 return log;
626}
627
628function attachCommandFields(
629 log: Record<string, any>,

Callers 1

defaultLogTransformFunction · 0.85

Calls 1

stringifyWithMaxLenFunction · 0.85

Tested by

no test coverage detected