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

Embed inheritance of properties in Collection, Db, and MongoClient

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • next
    • Affects Version/s: None
    • Component/s: None
    • None

      We currently use utility functions like resolveReadPreference, in order to determine the correct read preference/write concern/read concern for operations. These should become properties of the potential sources for inheritance (e.g. MongoClient.readPreference, Db.readConcern), and those getters should look for inherited values in the absence of a set value, e.g.

      class Db {
        get readPreference() {
          if (this.s.readPreference == null) {
            return this.s.client.readPreference;
          }
      
          return this.s.readPreference;
        }
      }

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: