In my database I have documents which all contain the property foo. For each value of foo I have a function that either returns true or false. How can I query for all the documents for which the value of foo makes the function return true?
In my database I have documents which all contain the property foo . For
Share
If you need to check if your string field’s value is one of several, you need the $in modifier.
It works fast and uses index (if possible).
If your field is an array and you pass a string, use this syntax.
It will check every element in the array and, if any of them matches your string, it will return the document.