[SERVER-29269] Issue with the "$gt and $lt" options in Aggregation Pipeline Created: 18/May/17 Updated: 19/May/17 Resolved: 19/May/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 3.2.11 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Marwa FRIAA [X] | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Operating System: | ALL |
| Participants: |
| Description |
|
My collection containes documents as follow: /* 2 */ { "_id" : ObjectId("591dae83e320467808f1e199"), "scenario" : "delc", "datavalue" : [ " _value: ", "A _value: 4", "B _value: 5", "C _value: 92", "D _value:94" ] }/* 3 */ { "_id" : ObjectId("591dae9ae320467808f1e19a"), "scenario" : "delc", "datavalue" : [ " _value: ", "A _value: 2", "C _value: 2", "D _value:4" ] }********************************************************************** When I want to search for "datavalue grater than A _value: 6" it does not work (returns all the documents) with simple $match $project as follow : }}, , "A" ] } ] } } } |
| Comments |
| Comment by Kelsey Schubert [ 19/May/17 ] |
|
Hi Marwa FRIAA, This is the expected behavior since the query is looking for an array that has values greater than "A_value: 6" (which is a string). Please note that the string "B_value" is greater than the string "A_value...". As I mentioned earlier, for MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-users group. See also our Technical Support page for additional support resources. Regards, |
| Comment by Marwa FRIAA [X] [ 18/May/17 ] |
|
But it works with $lt in other examples it works with $gt and not $lt . I don't understand why .. |