I have a likes array embed in photos collection. Likes array contains user_id, Every time the user presses the like button, I need to check if the user_id exists in the like array. If it doesn't exist, I push user_id to likes array, else I pull it out of likes array. So I need to perform two queries. I want to encapsulate them in a single query.
Photos:
"likes" : [
{
"user_id" : ObjectId("")
},
{
"user_id" : ObjectId("")
}
],