[SERVER-11078] MongoDB Query: Conditon operators “||” and “&&” returns unexpected result Created: 08/Oct/13 Updated: 08/Oct/13 Resolved: 08/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Question | Priority: | Minor - P4 |
| Reporter: | Jayanna Hallur [X] | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OS Type : Window 7, 32 bit machine Version: C:\mongodb\bin>mongo.exe -version MongoDB shell version: 2.4.6 C:\mongodb\bin> C:\mongodb\bin>mongod.exe -version db version v2.4.6 Tue Oct 08 16:08:54.073 git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673 |
||
| Participants: |
| Description |
|
Hi I’m seeing an unexpected result while querying with “||” and “”&&” conditioning operations. Looks like this is a bug.
Please let me know any clarification required by sending mail to jayanna.hallur@wipro.com Regards |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 08/Oct/13 ] | ||||||
|
You need to put the "&&" "||" inside the quotes. What you have now is evaluated by javascript as && of two strings: Incorrect:
Correct:
|