0

I am using spring-boot-starter-data-mongodb and I am creating a BSON query to execute a updateMany operation

The query is fairly simple. I want to find all documents whose _id is contained in String List

listOfStrings = List.of("123", "456");

Bson query = and(in("_id", listOfStrings));

but this query does not produce any match (documents with these IDs exist in the collection). If I use same query but with another field from the document, it will work fine.

Any idea how I can build this query ?

0 Answers0