[SERVER-20706] Comparison operators do not work embedded documents Created: 30/Sep/15 Updated: 30/Sep/15 Resolved: 30/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 3.1.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Sveta | Assignee: | David Storch |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: |
|
||||||||
| Participants: | |||||||||
| Description |
|
If you want to query embedded document, for example, "dt" of {"bef" : { "dt" : 20090401 }} and compare it with a value, simple comparison ({ "dt" : 20090401 }) will work, but $lte/$gte and other comparison operators would not |
| Comments |
| Comment by David Storch [ 30/Sep/15 ] | |
|
kay.kim, do we currently have any query language documentation that could help users with the "gotcha" reported here and in | |
| Comment by Sveta [ 30/Sep/15 ] | |
|
David, Thank you for the explanation. Wouldn't it be good idea to update documentation at http://docs.mongodb.org/manual/reference/operator/query-comparison/ with similar explanation? | |
| Comment by David Storch [ 30/Sep/15 ] | |
|
Hi svetasmirnova, I am closing this ticket as a duplicate of
means to find documents where the "bef" field contains the literal nested object { "dt" : {$lte: 20090401} }. It does not mean to find documents where there is a path "def.dt" containing a numerical value less than or equal to 20090401. Note that { "dt" : {$lte: 20090401} } is not actually a valid user document for storage in a collection due to the dollar-prefixed "$lte" field. However, the query engine does not currently validate that a query for a literal nested document contains a valid document for storage since this would be wasted work for most queries. Best, | |
| Comment by Sveta [ 30/Sep/15 ] | |
|
Originally reported at https://groups.google.com/forum/#!topic/tokumx-user/FXVdkhRa80Y |