The following code allows us to update all documents in customerDetail
collection where customer_user_id
is 1
:
db.getCollection("customerDetail")
.updateMany(Filters.eq("customer_user_id", 1),
Updates.combine(
Updates.set("birth_year", "birth_year"),
Updates.set("country", "country")
));
but I need to update ALL documents in the collection, so I need to find a way how to ask Java Driver do not apply any filters to update query, but as I can see for updateMany
method Filter
is a mandatory attribute and I can't just pass null
.
So how can I update all documents?