db.tablename.find(
{"_id.period":{"$gte": ISODate("2011-01-01T00:00:00"), "$lte": ISODate("2011-12-31T23:59:59")},
{"$or": [{"value.field1": "COMMUNICATION", "value.field2": "GOVERNMENT INSTITUTIONS - LOCAL"}, {"value.field1": "COMMUNICATION", "value.field2": "INTERNET SERVICE PROVIDER"}]}
})
the solution:
#remove { } wrapper from $or
{"_id.period":{"$gte": ISODate("2011-01-01T00:00:00"), "$lte": ISODate("2011-12-31T23:59:59")},
"$or": [{"value.field1": "COMMUNICATION", "value.field2": "GOVERNMENT INSTITUTIONS - LOCAL"}, {"value.field1": "COMMUNICATION", "value.field2": "INTERNET SERVICE PROVIDER"}]
})
1 comment:
Thanks man, this saved my life!
Post a Comment