MongoDB C++ Driver  mongocxx-3.7.0
Public Member Functions | List of all members
mongocxx::result::insert_many Class Reference

Class representing the result of a MongoDB insert many operation (executed as a bulk write). More...

#include <insert_many.hpp>

Public Member Functions

const result::bulk_writeresult () const
 Returns the bulk write result for this insert many operation. More...
 
std::int32_t inserted_count () const
 Gets the number of documents that were inserted during this operation. More...
 
id_map inserted_ids () const
 Gets the _ids of the inserted documents. More...
 

Detailed Description

Class representing the result of a MongoDB insert many operation (executed as a bulk write).

Member Function Documentation

◆ inserted_count()

std::int32_t mongocxx::result::insert_many::inserted_count ( ) const

Gets the number of documents that were inserted during this operation.

Returns
The number of documents that were inserted.

◆ inserted_ids()

id_map mongocxx::result::insert_many::inserted_ids ( ) const

Gets the _ids of the inserted documents.

Note
The returned id_map must not be accessed after the result::insert_many object is destroyed.
Returns
Map of the index of the operation to the _id of the inserted document.

◆ result()

const result::bulk_write& mongocxx::result::insert_many::result ( ) const

Returns the bulk write result for this insert many operation.

Returns
The raw bulk write result.

The documentation for this class was generated from the following file: