[SERVER-995] The structure of the OPT_QUERY packet is not consistent Created: 11/Apr/10  Updated: 03/Dec/15  Resolved: 03/Dec/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 1.5.0
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: pablo platt Assignee: David Storch
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

sort, hint, snapshot, explain(and more in the future) goes inside {$query :

{x:1}

, /* options */ }
for example: {$query :

{x:1}

, $orderby : {y:-1}}

skip, limit and fields are separate attributes.

There is no reason, other then historical I think, that there are two types of options.

Moving all the options inside the query doc will make the query packet more consistent, extensible, easier to code and understand drivers.
It is an easy change in the drivers and won't break the API.



 Comments   
Comment by David Storch [ 03/Dec/15 ]

We've done something similar to this by introducing a new "find command" in order to perform queries. See SERVER-15176 for details. We are not currently planning to change the format of the legacy OP_QUERY find messages.

Generated at Thu Feb 08 02:55:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.