I have a collection of emails in MongoDB with a field containing an array of json.
How can knowing the sender and the receiver, how can I find all the emails exchanged between the two people ? I need to do something like
db.email.find({"from": [email protected]", "tos":"[email protected]")
but I cant find the right way to write this query :(
> db.emails.findOne() { "from" : { "real_name" : "it", "address" : "[email protected]" }, "tos" : [ { "real_name" : null, "address" : "[email protected]" } ], }