-
Type: Task
-
Resolution: Done
-
Priority: 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).
- depends on
-
CDRIVER-1522 Add mongoc_collection_find_with_opts
- Closed
-
CSHARP-1896 Support deprecated "modifiers" FindOption in CRUD API
- Closed
-
JAVA-2427 Deprecate modifiers in FindOptions and replace with properties
- Closed
-
PYTHON-1217 Support all find command options as named parameters and deprecate the modifiers parameter
- Closed
-
RUBY-1195 Support deprecated "modifiers" FindOption in CRUD API
- Closed
-
CXX-1195 Support deprecated "modifiers" FindOption in CRUD API
- Closed
-
PHPLIB-255 Support deprecated "modifiers" FindOption in CRUD API
- Closed
-
NODE-911 Support deprecated "modifiers" FindOption in CRUD API
- Closed
- is related to
-
DRIVERS-348 Resync CRUD spec tests organized by minServerVersion and maxServerVersion
- Closed