[DOCS-12543] $and operator accepts one expression Created: 12/Mar/19 Updated: 30/Oct/23 Resolved: 27/Mar/19 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | 3.6.6 |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Typo | Priority: | Major - P3 |
| Reporter: | Betty Leung | Assignee: | Ravind Kumar (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 4 years, 46 weeks ago |
| Story Points: | 0.1 |
| Description |
DescriptionFrom the mongoDB documentation: {{}} $and performs a logical AND operation on an array of two or more expressions
However, I am able to run a mongo query with just one expression. For example in Studio 3T I run: db.getCollection("mycollection").find({ "$and": [ { "memId":"07e3c5560dc125689eb75bfd120ceb91" }] })
Is this a typo in the documentation or an incorrect implementation of mongoDB? Scope of changesImpact to Other DocsMVP (Work and Date)Resources (Scope or Design Docs, Invision, etc.) |
| Comments |
| Comment by Betty Leung [ 27/Mar/19 ] |
|
Thank you for the documentation updates and info @Ravind Kumar. I am able to run the $or operator with only one operation as well. However, the mongo documentation states: The $or operator performs a logical OR operation on an array of two or more<expressions> https://docs.mongodb.com/manual/reference/operator/query/or/#op._S_or
Is this also a documentation typo?{{}} |
| Comment by Ravind Kumar (Inactive) [ 27/Mar/19 ] |
|
Thanks for filing this betty.leung@interpreta.com. I've clarified the description to one or more arguments. As you noted, $and is perfectly happy with a single argument. I've backported the changes as well. If you run into any further issues with the MongoDB Documentation, please feel free to open another ticket. |
| Comment by Githook User [ 27/Mar/19 ] |
|
Author: {'email': 'ravind.kumar@mongodb.com', 'name': 'rk-mongo'}Message: Multiple small fixups: DOCSP-4943: $cond requires all arguments |
| Comment by Githook User [ 27/Mar/19 ] |
|
Author: {'email': 'ravind.kumar@mongodb.com', 'name': 'rk-mongo'}Message: Multiple small fixups:
|
| Comment by Githook User [ 27/Mar/19 ] |
|
Author: {'name': 'rk-mongo', 'email': 'ravind.kumar@mongodb.com'}Message: Multiple small fixups: DOCSP-4943: $cond requires all arguments |
| Comment by Githook User [ 27/Mar/19 ] |
|
Author: {'name': 'rk-mongo', 'email': 'ravind.kumar@mongodb.com'}Message: Multiple small fixups:
|