Loading...
Searching...
No Matches
mongocxx::v_noabi::options::insert Class Reference

`#include <mongocxx/v_noabi/mongocxx/options/insert.hpp>`

## Description

Used by mongocxx::v_noabi::collection.

## Public Member Functions

| insert ()=default
| Default initialization.
| insert (v1::insert_many_options opts)
| Construct with the mongocxx::v1 equivalent.
| insert (v1::insert_one_options opts)
| Construct with the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< bool > const & | bypass_document_validation () const
| Gets the current value of the bypass_document_validation option.
insert & | bypass_document_validation (bool bypass_document_validation)
| Sets the bypass_document_validation option. If true, allows the write to opt-out of document level validation.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const & | comment () const
| The current comment for this operation.
insert & | comment (bsoncxx::v_noabi::types::bson_value::view_or_value comment)
| Sets the comment for this operation.
| operator v1::insert_many_options () const
| Convert to the mongocxx::v1 equivalent.
| operator v1::insert_one_options () const
| Convert to the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< bool > const & | ordered () const
| The current ordered value for this operation.
insert & | ordered (bool ordered)
bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > const & | read_concern () const
| The current read_concern for this operation.
insert & | read_concern (v_noabi::read_concern rc)
| Sets the read_concern for this operation.
bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > const & | write_concern () const
| The current write_concern for this operation.
insert & | write_concern (v_noabi::write_concern wc)
| Sets the write_concern for this operation.

## Constructor & Destructor Documentation

## insert() [1/3]

mongocxx::v_noabi::options::insert::insert | ( |  | ) |

default

Default initialization.

## insert() [2/3]

mongocxx::v_noabi::options::insert::insert | ( | v1::insert_many_options | opts | ) |

Construct with the mongocxx::v1 equivalent.

## insert() [3/3]

mongocxx::v_noabi::options::insert::insert | ( | v1::insert_one_options | opts | ) |

Construct with the mongocxx::v1 equivalent.

## Member Function Documentation

## bypass_document_validation() [1/2]

bsoncxx::v_noabi::stdx::optional< bool > const & mongocxx::v_noabi::options::insert::bypass_document_validation | ( |  | ) | const

inline

Gets the current value of the bypass_document_validation option.

Returns
  The optional value of the bypass_document_validation option.

## bypass_document_validation() [2/2]

insert & mongocxx::v_noabi::options::insert::bypass_document_validation | ( | bool | bypass_document_validation | ) |

inline

Sets the bypass_document_validation option. If true, allows the write to opt-out of document level validation.

Note
  On servers >= 3.2, the server applies validation by default. On servers < 3.2, this option is ignored.

Parameters

  bypass_document_validation | Whether or not to bypass document validation

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## comment() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const & mongocxx::v_noabi::options::insert::comment | ( |  | ) | const

inline

The current comment for this operation.

Returns
  The current comment.

See also
  - https://www.mongodb.com/docs/manual/reference/command/insert/

## comment() [2/2]

insert & mongocxx::v_noabi::options::insert::comment | ( | bsoncxx::v_noabi::types::bson_value::view_or_value | comment | ) |

inline

Sets the comment for this operation.

Parameters

  comment | The new comment.

See also
  - https://www.mongodb.com/docs/manual/reference/command/insert/

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## operator v1::insert_many_options()

mongocxx::v_noabi::options::insert::operator v1::insert_many_options | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

## operator v1::insert_one_options()

mongocxx::v_noabi::options::insert::operator v1::insert_one_options | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

Note
  The ordered field is ignored.

## ordered() [1/2]

bsoncxx::v_noabi::stdx::optional< bool > const & mongocxx::v_noabi::options::insert::ordered | ( |  | ) | const

inline

The current ordered value for this operation.

Returns
  The current ordered value.

See also
  - https://www.mongodb.com/docs/manual/reference/command/insert/

## ordered() [2/2]

insert & mongocxx::v_noabi::options::insert::ordered | ( | bool | ordered | ) |

inline

Note
  : This applies only to insert_many and is ignored for insert_one.

If true, when an insert fails, return without performing the remaining writes. If false, when a write fails, continue with the remaining writes, if any. Inserts can be performed in any order if this is false. Defaults to true.

Parameters

  ordered | Whether or not the insert_many will be ordered.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

See also
  - https://www.mongodb.com/docs/manual/reference/command/insert/

## read_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > const & mongocxx::v_noabi::options::insert::read_concern | ( |  | ) | const

inline

The current read_concern for this operation.

Returns
  The current read_concern.

See also
  - https://www.mongodb.com/docs/manual/reference/read-concern/

## read_concern() [2/2]

insert & mongocxx::v_noabi::options::insert::read_concern | ( | v_noabi::read_concern | rc | ) |

inline

Sets the read_concern for this operation.

Parameters

  rc | The new read_concern.

See also
  - https://www.mongodb.com/docs/manual/reference/read-concern/

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## write_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > const & mongocxx::v_noabi::options::insert::write_concern | ( |  | ) | const

inline

The current write_concern for this operation.

Returns
  The current write_concern.

See also
  - https://www.mongodb.com/docs/manual/core/write-concern/

## write_concern() [2/2]

insert & mongocxx::v_noabi::options::insert::write_concern | ( | v_noabi::write_concern | wc | ) |

inline

Sets the write_concern for this operation.

Parameters

  wc | The new write_concern.

See also
  - https://www.mongodb.com/docs/manual/core/write-concern/

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

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

- mongocxx/v_noabi/mongocxx/options/insert.hpp