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

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -