[SERVER-29268] $gt Condition does'nt work Created: 18/May/17  Updated: 18/May/17  Resolved: 18/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

Operating System: ALL
Participants:

 Description   

I have each document has an array of strings named datavalues.
For example I have :

{ "_id" : ObjectId("58add926609495b90dc13ea2"), , "datavalue" : [ " _value: ", "A _value: 8", "B _value: 5", "C _value: 2", "D _value:4" ]}

When we search for "datavaues grater than 6 and starts with A " with an aggregation pipeline which contains $match and $project it returns all the datavalues.

I changed the pipeline to : $match , $project , $match , $project => it works !!

when I add another condition "documents contains datavaue grater than 6 and starts with A and datavalue contains B" => it returns all documents .



 Comments   
Comment by Marwa FRIAA [X] [ 18/May/17 ]

Hello Thomas ,
Thank you for your reply.
The $elementMatch operator does not work with Aggregation (and I have other constraints which require Aggregation).
Yes I attached the details and more clear example in an other issue : https://jira.mongodb.org/browse/SERVER-29269.
Thank you for the suggestion.
Regards.
Marwa.

Comment by Kelsey Schubert [ 18/May/17 ]

Hi Marwa FRIAA,

Your queries may require the $elemMatch operator.

Please note that SERVER project is for reporting bugs or feature suggestions for the MongoDB server. 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.

If you post to the user group, I would recommend providing the complete aggregation pipelines and the resulting output as well as the output you would like.

Regards,
Thomas

Generated at Thu Feb 08 04:20:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.