query to get the json array to compare value of different key in mongodb code example Example: mongodb find element in array db.yourCollection.find( { array: "element" } )