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

Function isPinnableCommand

src/sdam/server.ts:548–563  ·  view source on GitHub ↗
(cmd: Document, session?: ClientSession)

Source from the content-addressed store, hash-verified

546}
547
548function isPinnableCommand(cmd: Document, session?: ClientSession): boolean {
549 if (session) {
550 return (
551 session.inTransaction() ||
552 (session.transaction.isCommitted && 'commitTransaction' in cmd) ||
553 'aggregate' in cmd ||
554 'find' in cmd ||
555 'getMore' in cmd ||
556 'listCollections' in cmd ||
557 'listIndexes' in cmd ||
558 'bulkWrite' in cmd
559 );
560 }
561
562 return false;
563}
564
565function connectionIsStale(pool: ConnectionPool, connection: Connection) {
566 if (connection.serviceId) {

Callers 1

commandMethod · 0.85

Calls 1

inTransactionMethod · 0.80

Tested by

no test coverage detected