Skip to content

Commit

Permalink
fix(MongoMemoryReplSet): comment-out older hack
Browse files Browse the repository at this point in the history
- comment out the hack added by 470f094

closes #366
  • Loading branch information
hasezoey committed Sep 11, 2020
1 parent 19c7627 commit c9679d8
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,7 @@ export default class MongoMemoryReplSet extends EventEmitter {

// MongoClient HACK which helps to avoid the following error:
// "RangeError: Maximum call stack size exceeded"
// in ./node_modules/mongodb/lib/core/sdam/topology_description.js:263:51
// Under the hood initiated server topology has type `RSGhost`
// and this server does not support session
// so for skipping the following code
// https://github.com/mongodb/node-mongodb-native/blob/dc70c2de7d3dae2617708c45a1ea695d131e15f3/lib/operations/execute_operation.js#L33-L39
// we just override shouldCheckForSessionSupport() method for current connection instance
(db as any).topology.shouldCheckForSessionSupport = () => false;
// (db as any).topology.shouldCheckForSessionSupport = () => false; // TODO: remove after 1.1.2021 if no issues arise

/** reference to "db.admin()" */
const admin = db.admin();
Expand Down

0 comments on commit c9679d8

Please sign in to comment.