I have a User collection with an embedded Address collection. I want to find or initialize a document with user email and embedded document address' field zipcode. Both these queries return the user object independently.
User.find_or_initialize_by(email: "contact@yahoo.com")
User.find_or_initialize_by("address.zipcode": "14421")
However, the following query does not return an object
User.find_or_initialize_by(email: "contact@yahoo.com", "address.zipcode": "14421")
I can't figure out why.