Interface ClientInsertOneResult


@Evolving public interface ClientInsertOneResult
The result of a successful individual insert one operation. Note that WriteConcernErrors are not considered as making individual operations unsuccessful.
Since:
5.3
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<org.bson.BsonValue>
    The "_id" of the inserted document.
  • Method Details

    • getInsertedId

      Optional<org.bson.BsonValue> getInsertedId()
      The "_id" of the inserted document.
      Returns:
      The "_id" of the inserted document. Present unless a RawBsonDocument is inserted, because the driver neither generates the missing "_id" field for a RawBsonDocument, nor does it read the "_id" field from a RawBsonDocument when inserting it.