Function
isPinnableCommand
(cmd: Document, session?: ClientSession)
Source from the content-addressed store, hash-verified
| 546 | } |
| 547 | |
| 548 | function 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 | |
| 565 | function connectionIsStale(pool: ConnectionPool, connection: Connection) { |
| 566 | if (connection.serviceId) { |
Tested by
no test coverage detected