Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-887

Create an example of getting _id's from insert results

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.2
    • Affects Version/s: None
    • Component/s: API

      Hey there,

      I'm using c++11 driver and going to extract the Hex-ID of a youst inserted document with the function collection.insert_one.

      Is there a function I can coll to extract the ID out of the returned Object?
      Can't find any example.

      struct core::v1::optional<mongocxx::v_noabi::result::insert_one> retVal3 = collection.insert_one(document.view());

      std::string = retVal3.IDplease(); // or the hex code. anything? =)

            Assignee:
            Unassigned Unassigned
            Reporter:
            Weltenbummler Armin Ball [X]
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: