Skip to content

Instantly share code, notes, and snippets.

@banker
Forked from francois/gist:351945
Created April 1, 2010 17:49
Show Gist options
  • Save banker/352135 to your computer and use it in GitHub Desktop.
Save banker/352135 to your computer and use it in GitHub Desktop.
{"rp":
{"AdSpot": [
{"1": {"a": "b"}},
{"2": {"a": "b"}},
{"3": {"a": "b"}}]
}
}
db.collection.find({"rp.AdSpot": {$in: [{"1": {"a": "b"}}, {"2": {"a": "b"}]}})
# Or
{"rp":
{"AdSpot": [
{"a": "a"},
{"a": "b"},
{"a": "c"}]
}
}
db.collection.find("rp.AdSpot": {"$in": [{"a": "a"}, {"a": "c"}]})
db.collection.find({"rp.AdSpot.a": "b"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment