How to use the NEAREST function from mongodb

Find comprehensive JavaScript mongodb.NEAREST code examples handpicked from public code repositorys.

79
80
81
82
83
84
85
86
87
let myObjectReadPreference = null;
databaseAdapter.database.serverConfig.cursor.calls.all().forEach(call => {
  if (call.args[0].indexOf('MyObject') >= 0) {
    myObjectReadPreference = true;
    expect(call.args[2].readPreference.preference).toBe(
      ReadPreference.NEAREST
    );
  }
});
fork icon0
star icon63
watch icon9

+ 3 other calls in file