mongodb - $geoWithin with $in or $or -
i need issue, thing simple, i've tried this:
db.things.find({"position": {'$in': [{"$geowithin":{"$center": [[10,10],10] } }, null ] } }) and this:
db.things.find({$or: [{"position":{"$geowithin":{"$center":[[10,10],10]}}, "position": null}]}) neither of them work, need "things" in circle or "things" don't have position field. have add query returns document don't have field, excluding docs in circle.
any apreciated.
thanks
i don't think $in work you, because per documentation
$in selects documents field value equals value in specified array
you can modify $or query below:
db.things.find({"$or": [{"position":{"$geowithin":{"$center":[[10,10],10]}}, "position":{"$exits": false}}]}) hope works :)
Comments
Post a Comment