Closed panrafal closed 11 years ago
yep, but presently update_safe
is:
public function update_safe ($criteria, $update, $options = array(), $upsert = false, $multi = false)
{
...
}
in my opinion $upsert
and $multi
not needed here.
Actually, if you look at the php-prototype of update
method, we can see the following:
public bool|array MongoCollection::update ( array $criteria , array $new_object [, array $options = array() ] )
.
In his turn MongoDB defines this method as follows:
db.collection.update(query, update[, options])
By this, I don't see the point of invent additional arguments for update_safe
.
See please:
Also for a better understanding, I suggest to rename $update
to $new_object
From my pov it's more convenient to have the most used parameters available right on the function - especially if you use any kind of code completion. But I understand yours, especially the part with original mongo api :)
@panrafal If it weren't for the redundancy which causes ambiguity then I'd agree with you. Reverted.
Actually, looking back at this I don't get the motivation for this patch.. update_safe already allows for overriding these options:
So now there are two ways to override multiple and upsert so I think this should be reverted..