Loading...
Searching...
No Matches
mongocxx::v1::insert_one_result Class Reference

`#include <mongocxx/v1/insert_one_result.hpp>`

## Description

The result of an "insertOne" operation.

Supported fields include:

- result
- inserted_id

See also
  - Insert Methods (MongoDB Manual)

## Public Member Functions

| insert_one_result (insert_one_result &&other) noexcept
| Move constructor.
| insert_one_result (insert_one_result const &other)
| Copy construction.
| ~insert_one_result ()
| Destroy this object.
bsoncxx::v1::types::view | inserted_id () const
| Return the inserted document ID.
insert_one_result & | operator= (insert_one_result &&other) noexcept
| Move assignment.
insert_one_result & | operator= (insert_one_result const &other)
| Copy assignment.
v1::bulk_write::result | result () const
| Return the raw bulk write result.

## Friends

bool | operator== (insert_one_result const &lhs, insert_one_result const &rhs)
| Compare equal when all supported fields compare equal.
bool | operator!= (insert_one_result const &lhs, insert_one_result const &rhs)
| Compare equal when all supported fields compare equal.

## Constructor & Destructor Documentation

## ~insert_one_result()

mongocxx::v1::insert_one_result::~insert_one_result | ( |  | ) |

Destroy this object.

Warning
  Invalidates all associated views.

## insert_one_result() [1/2]

mongocxx::v1::insert_one_result::insert_one_result | ( | insert_one_result && | other | ) |

noexcept

Move constructor.

Postconditions:
  - other is in an assign-or-destroy-only state.

## insert_one_result() [2/2]

mongocxx::v1::insert_one_result::insert_one_result | ( | insert_one_result const & | other | ) |

Copy construction.

## Member Function Documentation

## inserted_id()

bsoncxx::v1::types::view mongocxx::v1::insert_one_result::inserted_id | ( |  | ) | const

Return the inserted document ID.

## operator=() [1/2]

insert_one_result & mongocxx::v1::insert_one_result::operator= | ( | insert_one_result && | other | ) |

noexcept

Move assignment.

Postconditions:
  - other is in an assign-or-destroy-only state.

## operator=() [2/2]

insert_one_result & mongocxx::v1::insert_one_result::operator= | ( | insert_one_result const & | other | ) |

Copy assignment.

## result()

v1::bulk_write::result mongocxx::v1::insert_one_result::result | ( |  | ) | const

Return the raw bulk write result.

## Friends And Related Symbol Documentation

## operator!=

bool operator!= | ( | insert_one_result const & | lhs,
|  | insert_one_result const & | rhs )

friend

Compare equal when all supported fields compare equal.

## operator==

bool operator== | ( | insert_one_result const & | lhs,
|  | insert_one_result const & | rhs )

friend

Compare equal when all supported fields compare equal.

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

- mongocxx/v1/insert_one_result.hpp