Text operators
📌 $regex
To match fields with string values. You can also look for full text using $text
db.movieDetails.find({“awards.text”: {$regex: /^Won .*/}})
Description of regex
Slashes delimit the regular expression
The char ^ means start at the beginning of the field we are matching
Then match exactly the characters stated
The . means match any character
The * means match any number of times
Last updated
Was this helpful?