[CDRIVER-1522] Add mongoc_collection_find_with_opts Created: 06/Sep/16 Updated: 13/Jan/17 Resolved: 21/Sep/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.4.0 |
| Fix Version/s: | 1.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Epic Link: | Flexible opts | ||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Description |
|
New function takes options expressed as a free-form BSON document. Paves the way to a more flexible future API in which we can add support for arbitrary options without API expansions.
The plan:
|
| Comments |
| Comment by Githook User [ 05/Jan/17 ] | ||||||||||||
|
Author: {u'username': u'ooglek', u'name': u'Peter Beckman', u'email': u'beckman@angryox.com'}Message: | ||||||||||||
| Comment by Githook User [ 05/Jan/17 ] | ||||||||||||
|
Author: {u'username': u'ooglek', u'name': u'Peter Beckman', u'email': u'beckman@angryox.com'}Message: | ||||||||||||
| Comment by Githook User [ 27/Nov/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 17/Nov/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Hannes Magnusson [ 17/Nov/16 ] | ||||||||||||
|
This commit introduced new warning:
| ||||||||||||
| Comment by Githook User [ 21/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 21/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 14/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 14/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 14/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Update signature for consistency with mongoc_collection_count_with_opts: | ||||||||||||
| Comment by Githook User [ 13/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Update signature for consistency with mongoc_collection_count_with_opts: | ||||||||||||
| Comment by Githook User [ 13/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Two changes in particular. First, $-modifiers once again have the "$" Second, "filter" is no longer treated specially by the old "find()", so | ||||||||||||
| Comment by Githook User [ 13/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 13/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 13/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 13/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 13/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 12/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: Revert " This reverts commit a497587867fe28dac954d0244ca6fb4bfc5e4a38. | ||||||||||||
| Comment by Githook User [ 10/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 10/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 10/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 09/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 09/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 09/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 08/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 08/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 08/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 07/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: support negative nToReturn in mock server This will help test mongoc_collection_find_with_opts, | ||||||||||||
| Comment by Githook User [ 07/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Githook User [ 07/Sep/16 ] | ||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: | ||||||||||||
| Comment by Bernie Hackett [ 06/Sep/16 ] | ||||||||||||
|
It's not actually a whitelist. Keys not in _MODIFIERS pass through unchanged:
| ||||||||||||
| Comment by Jeremy Mikola [ 06/Sep/16 ] | ||||||||||||
|
FWIW, PHPC's Query constructor takes a modifiers option for this purpose, and also because we didn't want to support some options like hint in advance of them making it into the CRUD spec. If I'm reading the PyMongo code correctly, the translation is only done for known modifiers. To be clear, is that (whitelist) what you're suggesting for libmongoc as well? Just want to be sure that "foo" above is a placeholder for a known modifier and not just anything | ||||||||||||
| Comment by Bernie Hackett [ 06/Sep/16 ] | ||||||||||||
|
That looks like what we do in PyMongo. https://github.com/mongodb/mongo-python-driver/blob/3.3.0/pymongo/message.py#L143-L181 | ||||||||||||
| Comment by A. Jesse Jiryu Davis [ 06/Sep/16 ] | ||||||||||||
|
behackett what do you think about Jeremy's question above? If someone calls mongoc_collection_find_with_opts with opts {foo: true} and we're talking to MongoDB 3.2+, do we send this command?:
And for older servers, an OP_QUERY with "$" added to "foo" ?:
I think we should do this, to ensure support for future "find" command features and to ensure we didn't miss any obscure OP_QUERY features. | ||||||||||||
| Comment by Jeremy Mikola [ 06/Sep/16 ] | ||||||||||||
Do these two statements conflict? For legacy OP_QUERY usage, would we simply stuff $-prefixed modifiers into the first argument (i.e. filter document) and wrap the filter with $query as we presently do with mongoc_collection_find()? |