You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, each update is an atomic document modification. Updating multiple fields simultaneously requires doing a raw update with MongoDB operators. That's particularly painful for arrays with the $each required.
There should be some sugar like this:
$obj->update_multi(
set => [ field, value ],
set => [ field, value ],
push => [ field, value],
...
);
The underlying calls should be split into an update statement generator and an executor. Then update_multi could just generate multiple operations and put them in one update document to fire off to update.
I think the "signature" of each should resemble the individual call. For example, if update_set only takes a pair, then set should take an arrayref with a pair. Later, if update_set is modified to take a hash ref or multiple pairs, then maybe it could be modified here.
The text was updated successfully, but these errors were encountered:
Right now, each update is an atomic document modification. Updating multiple fields simultaneously requires doing a raw
update
with MongoDB operators. That's particularly painful for arrays with the$each
required.There should be some sugar like this:
The underlying calls should be split into an update statement generator and an executor. Then
update_multi
could just generate multiple operations and put them in one update document to fire off toupdate
.I think the "signature" of each should resemble the individual call. For example, if
update_set
only takes a pair, thenset
should take an arrayref with a pair. Later, ifupdate_set
is modified to take a hash ref or multiple pairs, then maybe it could be modified here.The text was updated successfully, but these errors were encountered: