When I query my database with:
{
"metadata.text": "Hello world"
}
I get:
{
"_id": {
"$oid": "5a455574d93b6a44cd95b210"
},
"metadata": {
"text": "Hello world"
}
}
I want to modify the query so that it matches anything with 'world'. When I try:
{
"metadata.text": {
"$regex": "/world/"
}
}
I get no matches.
How do I modify my query so that it matches any text containing 'world'?