If I have some json like this:
query = {
"canonical.operatingSystemFamily": "Linux",
"canonical.region": "us-east-1"
}
I can pass that directly into find and it works:
self._db_conn[collection_name].find(query)
I want to do the same, but with lists, e.g.:
query = {
"canonical.operatingSystemFamily": ["Linux","Windows"],
"canonical.region": ["us-east-1", "us-east-2"]
}
Is there a way to do that? I know about "$in" but I do not want to have to parse my query data. This is a very simplified example, and there are a lot of fields that may or may not be there. Is there a way to use that json with lists directly?
$inwhich is good. You don't want to parse query data -- but how did you get["Linux","Windows"]attached tocanonical.operatingSystemFamily? That didn't come directly from the app did it?"canonical.operatingSystemFamily"and"canonical.region"?