Assuming a collection like this:
People
{
"name": "John Doe",
"email": "John Doe <[email protected]>",
"stuff": "foo"
"morestuff": "bar"
},
{
"name": "Homer Simpson",
"email": "Homer Simpson <[email protected]>",
"stuff": "bar"
"morestuff": "foo"
},
{
"name": "Bart Simpson",
"email": "Bart Simpson <[email protected]>",
"stuff" : "foo"
"morestuff": "foo"
"evenmore": ["bar", "foo", "baz"]
}
What might be the best way to find all occurrences of the string 'foo' (exactly, no substring), whereever it might occur? What I'd like to accomplish is to update all occurences of the string 'foo' to some other string, or delete it from a document in the collection.
I know this might look like a bad database design, I just want to make clear what I'd like to do :)