How do I compare the equality of two documents? Let’s say I have new data coming from a web form. In that form I have an external
id that gets stored along with all the fields. So when data comes from the client, I do a query utilizing that external
id, given that I have a match I would like to know if the rest of the values are equals or not, in other words, I’m comparing the entire document against each other, the one coming from the client and the one already in the database.
I would like to know if Mongo itself has an operator ($eq, $lookup, etc) for comparing two documents.