Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-377

Mongo client db options readPreference && readPreferenceTags are correctly inherited to server commands?

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 2.0.22
    • Affects Version/s: 2.0.17, 2.0.18
    • Component/s: None
    • Environment:
      geographically distributed Replica Set-1 primary(p=2)(loc=fr),2 secondaries(p=2)(loc=ro),4 passives(priority=0)(loc=us).

      var MongoClient = require('mongodb').MongoClient;

      // Connection URL
      var url = 'mongodb://replicationURL/myproject';

      MongoClient.connect(url, {
      db:

      { readPreference : 'nearest', readPreferenceTags:['loc':'us'] }

      }, function(err, db) {
      assert.equal(null, err);
      console.log("Connected correctly to server");

      var col = db.collection('test');
      col.find().toArray(function(err,result)

      { //the result array represent objects from 'loc'=='us'??????????? }

      );

      });

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            mciocan Marius Ciocan
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: