Skip to content
Advertisement

Tag: mongo-java

MongoDB 4.4, Java driver 4.2.3 – InsertManyResult.getInsertedIds() not returning IDs for all inserted documents

I am trying to retrieve values of _id for inserted documents after successful InsertMany operation. To achieve this I am using InsertManyResult.getInsertedIds(). While this approach works most of the time there are cases where not all _id values are retrieved. I am not sure if I am doing something wrong but I would assume that InsertManyResult.getInsertedIds() returns _id for all

Advertisement