vertx-mongo-client
vertx-mongo-client copied to clipboard
Bulk write missing inserted ids in response
Using latest vertx mongo client when bulkWrite is called in response we are missing list of inserted item ids, this list is part of response inside mongodb driver:
package com.mongodb.bulk;
public abstract class BulkWriteResult {
...
/**
* Gets an unmodifiable list of inserted items, or the empty list if there were none.
*
* @return a list of inserted items, or the empty list if there were none.
* @throws java.lang.UnsupportedOperationException if the write was unacknowledged.
* @see com.mongodb.WriteConcern#UNACKNOWLEDGED
* @since 4.0
*/
public abstract List<BulkWriteInsert> getInserts();
...
but it is not mapped after successful operation (only list of upsert ids is mapped):
package io.vertx.ext.mongo.impl;
class Utils {
...
static MongoClientBulkWriteResult toMongoClientBulkWriteResult(BulkWriteResult bulkWriteResult) {
if (!bulkWriteResult.wasAcknowledged()) {
return null;
}
List<JsonObject> upsertResult = bulkWriteResult.getUpserts().stream().map(upsert -> {
JsonObject upsertValue = convertUpsertId(upsert.getId());
upsertValue.put(MongoClientBulkWriteResult.INDEX, upsert.getIndex());
return upsertValue;
}).collect(Collectors.toList());
return new MongoClientBulkWriteResult(
bulkWriteResult.getInsertedCount(),
bulkWriteResult.getMatchedCount(),
bulkWriteResult.getDeletedCount(),
bulkWriteResult.getModifiedCount(),
upsertResult
);
}
...
Would you like to contribute?
Yes, I would. I will probably need someone help with initial steps (Eclipse user id and ECA sign)...
- Sign the ECA http://www.eclipse.org/contribute/cla
- Configure your fork so that the author email and user email are the same as the one of your Eclipse account
- Sign-off your commit before pushing (with
-s
)
@tsegismont hi, I created pull request and tried to drop email to [email protected], as it is stated in guidelines... but I got error from mail server that I do not have permissions to post there, maybe I miss some of steps... Please review pull request when you have time.
Closed by 056bff0