List<WriteModel<Document>> updateList =
new ArrayList<WriteModel<Document>>(documents.size());
documents.stream().forEach((document) -> {
updateList.add(new UpdateOneModel<Document>(
new Document().append("accountNum",
document.get("accountNum")),
new Document().append("$set", document)));
});
BulkWriteResult result = securitiesCollection.bulkWrite(updateList,
MongoDbConstants.ORDERED_OPTION_FALSE);
In above code, Im trying to update subset of attributes in a document. After update I see whole document is replaced with just the subset. Is there a way to update a subset of attributes using bulkwrite operations using mongo-java-driver.