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
We want to use BulkOperations with AggregationUpdates.
Currently, BulkOperations defines its API like below, using Update and not UpdateDefinition.
publicinterfaceBulkOperations {
/** * Add a list of updates to the bulk operation. For each update request, only the first matching document is updated. * * @param updates Update operations to perform. * @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}. */BulkOperationsupdateOne(List<Pair<Query, Update>> updates);
/** * Add a single update to the bulk operation. For the update request, all matching documents are updated. * * @param query Update criteria. * @param update Update operation to perform. * @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}. */BulkOperationsupdateMulti(Queryquery, Updateupdate);
/** * Add a list of updates to the bulk operation. For each update request, all matching documents are updated. * * @param updates Update operations to perform. * @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}. */BulkOperationsupdateMulti(List<Pair<Query, Update>> updates);
/** * Add a single upsert to the bulk operation. An upsert is an update if the set of matching documents is not empty, * else an insert. * * @param query Update criteria. * @param update Update operation to perform. * @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}. */BulkOperationsupsert(Queryquery, Updateupdate);
/** * Add a list of upserts to the bulk operation. An upsert is an update if the set of matching documents is not empty, * else an insert. * * @param updates Updates/insert operations to perform. * @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}. */BulkOperationsupsert(List<Pair<Query, Update>> updates);
}
Looking at the code and usage, this could be switched to UpdateDefinition and thus be more generic.
Background is, that we want to use AggregationUpdate with the bulk api and this class does only implement UpdateDefinition and not extend Update.
Refine updateOne/updateMulti signatures to accept UpdateDefinition in the generic signature. Use pattern variables and records where applicable. Resolve code duplicates.
See #3872
Original pull request: #4344
We want to use BulkOperations with AggregationUpdates.
Currently, BulkOperations defines its API like below, using
Update
and notUpdateDefinition
.Looking at the code and usage, this could be switched to
UpdateDefinition
and thus be more generic.Background is, that we want to use
AggregationUpdate
with the bulk api and this class does only implementUpdateDefinition
and not extend Update.Proposal:
BulkOperations upsert(List<Pair<Query, Update>> updates);
should become
<U extends UpdateDefinition> BulkOperations upsert(List<Pair<Query, U>> updates);
The text was updated successfully, but these errors were encountered: