Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-347

Support deprecated "modifiers" FindOption in CRUD API

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: None

      The CRUD specification now states:

      Q: Where did modifiers go in FindOptions?
      MongoDB 3.2 introduced the find command. As opposed to using the general "modifiers" field any longer, each relevant option is listed explicitly. Some options, such as "tailable" or "singleBatch" are not listed as they are derived from other fields. Upgrading a driver should be a simple procedure of deprecating the "modifiers" field and introducing the new fields. When a collision occurs, the explicitly specified field should override the value in "modifiers".

      Drivers still supporting a "modifiers" option for find() should only fall back to values in that document if the first-class option is not specified. This snippet from the PHP driver may serve as an example.

      • "comment" option falls back to "$comment" modifier option
      • "hint" option falls back to "$hint" modifier option
      • "max" option falls back to "$max" modifier option
      • "maxScan" option falls back to "$maxScan" modifier option
      • "maxTimeMS" option falls back to "$maxTimeMS" modifier option
      • "min" option falls back to "$min" modifier option
      • "returnKey" option falls back to "$returnKey" modifier option
      • "showRecordId" option falls back to "$showDiskLoc" modifier option
      • "sort" option falls back to "$orderby" modifier option
      • "snapshot" option falls back to "$snapshot" modifier option

      The CRUD spec does not dictate an "explain" option for find(); however, drivers should ensure that the "$explain" modifier is still supported for legacy queries (i.e. not using the find command).

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: