[SERVER-26056] MongoDb $where clause returning incorrect results Created: 11/Sep/16 Updated: 12/Sep/16 Resolved: 12/Sep/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Stability |
| Affects Version/s: | 3.2.8 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Arockia Anto [X] | Assignee: | Kelsey Schubert |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | query | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
{ , , |
||
| Operating System: | ALL |
| Steps To Reproduce: | Create collection (EMPLOYEES) and insert the below doc. {"_id" : ObjectId("57d1a113666f6fc012f2708f"), "employee_id" : 107, "first_name" : "Diana", "last_name" : "Lorentz", "email" : "DLORENTZ", "phone_number" : "590.423.5567", "hire_date" : "07-FEB-99", "job_id" : "IT_PROG", "salary" : 4200, "manager_id" : 103, "department_id" : 60}Now execute the below 2 query and compare the results db.EMPLOYEES.find({$where: " return false "});` if i execute the the same logic in other way using the below query, its returning records from EMPLOYEES collection which is incorrect. `db.EMPLOYEES.find({$where: function(){return false}});` |
| Participants: |
| Description |
|
$where clause producing inconsistent results Please refer the steps to reproduce section for detailed description. |
| Comments |
| Comment by Kelsey Schubert [ 12/Sep/16 ] |
|
Hi ArockiAnto, Thank you for the detailed report. Please be aware that this build of MongoDB is deprecated. Unfortunately, we were unable to reproduce this behavior with the same 32-bit build. For MongoDB-related support discussion please post on the mongodb-users group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-users group. Kind regards, |