-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.7.4
-
Component/s: Geo
-
None
-
ALL
Problem:
Can't seen to combine $within with additional predicate
Reproduce:
> db.testcol.find()
{ "_id" : "1", "title" : "Doc1", "loc" :
, "occurences" : [
,
{ "instanceId" : 2, "startDate" : ISODate("2011-01-30T03:00:00Z") }] }
{ "_id" : "2", "title" : "Doc2", "loc" :
, "occurences" : [
,
{ "instanceId" : 2, "startDate" : ISODate("2011-01-25T03:00:00Z") }] }
This works
> db.testcol.find({ "loc": { "$within":
...
}
... })
{ "_id" : "1", "title" : "Doc1", "loc" :
, "occurences" : [
,
{ "instanceId" : 2, "startDate" : ISODate("2011-01-30T03:00:00Z") }] }
{ "_id" : "2", "title" : "Doc2", "loc" :
, "occurences" : [
,
{ "instanceId" : 2, "startDate" : ISODate("2011-01-25T03:00:00Z") }] }
However, restricting by occurences.startDate returns no documents
> db.testcol.find({ "loc": { "$within":
...
},
... "occurences.startDate":
... { "$gte": new Date(2011,0,23)}})
- related to
-
SERVER-2381 Cannot use compound of 2d and multikey index
- Closed