[SERVER-10709] Invalid BSON docs lead to errors in complex queries Created: 08/Sep/13 Updated: 10/Dec/14 Resolved: 09/Sep/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 2.4.5, 2.4.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Fabrizio Moscon | Assignee: | Stennie Steneker (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | bson, query | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
linux ubuntu 12.10 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Operating System: | Linux | ||||||||
| Steps To Reproduce: | load this dump: http://privatepaste.com/download/576b7e1184 run the index: db.users5.ensureIndex( { "_id": 1, "times.current_location": 1, "places.current.geolocation" : "2dsphere"}, { "sparse": true }); run this command , "spherical" : true } ) |
||||||||
| Participants: | |||||||||
| Description |
|
I believe there are few documents stored in my db which are not BSON valid or cause issue when retured, since when they are included into the result set of $and $or $geonear queries they made it error. I have identified one record which is definitely causing this problem. The only thing I can see is when I print it on the shell it indents wrongly and misses some key, but when it is exported it is a valid JSON and the dump also looks a correct binary. db.runCommand( { "geoNear": 'users5', "near": { "type": "Point", "coordinates": [ 0, 0 ] }, "spherical": true, num: 1 } ) Further details on http://pastie.org/8308587 |
| Comments |
| Comment by Stennie Steneker (Inactive) [ 09/Sep/13 ] |
|
Hi Fabrizio, The issue is that 2dsphere indexes in 2.4.6 do not honour the sparse option and are not sparse by default. See I tested your sample data with MongoDB 2.5.2 (unstable/development release) and the $geoNear works as expected (note: you do not have to specify sparse). I'm resolving this as a duplicate of Regards, |