Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3345

Get ID of last inserted document in a mongoDB w/ Java driver - WITH TYPED COLLECTION

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Command Operations
    • Labels:
      None

      For typed/generic collections, the @BsonId field is not recognized and changed by the driver. It seems impossible to get the object id of the last inserted document.  For details, please see: https://stackoverflow.com/questions/54362159/get-id-of-last-inserted-document-in-a-mongodb-w-java-driver-with-typed-collec

      I'm asking this feature request because I did not get an answer for almost 6 months. I suppose that there is no good solution for this question other than changing the API. This change would probably be backwards compatible (I'm not 100% sure though).

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            nagylzs Nagy László Zsolt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: