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 } )
{
"ns" : "your_db.users5",
"results" : [ ],
"errmsg" : "exception: wrong type for field () 10 != 2",
"code" : 13111,
"ok" : 0
}
Further details on http://pastie.org/8308587
- duplicates
-
SERVER-9639 2dsphere indexes with {2dsphereIndexVersion:2} should be sparse on geo fields
- Closed