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

Create an example of getting _id's from insert results

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.2
    • Component/s: API
    • Labels:
    • Sprint:
      Perl and CXX Team (2016-06-17)

      Description

      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? =)

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: