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

Support deprecated "modifiers" FindOption in CRUD API

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None

    Description

      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).

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: