There seem to be problems with the first two arguments to update()
. Those arguments are for the data and conditions, so you don't need those keys in the arrays you are passing. Try this.
Feeds::update(
array('$addToSet' =>
array('user_id' => $user["_id"])
), //what to change
array('address' => $address), //where to change it
array('upsert' => true)
);
I'm not sure why the query doesn't work for you directly in MongoDB. That works fine for me.