Meteor push if not exist pull if exist id in array

So I have a table where I save user favorite objects (server side). When user press like button on object user id and object id is saved (here’s code)

var value = Collections.UsersFavLocations.update({userId: userId}, { $push: { objectsList: id }}, { upsert: true } );
problem is when user press that button again (I need to check if object id already exist int objectsList and if exist simply remove it) (remove only object id from objectsList collection, not entire document). I know it sounds easy and I was thinking of using pull command. But problem is how I need to know if id is already in objectsList collection?

I would suggest checking the state in the UI code, and then send either a push or a pull. I think that makes sense, then if the user accidentally sends two requests for some reason, they won’t nullify each other.