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

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

## Description

Used by mongocxx::v_noabi::collection.

## Public Member Functions

| replace ()=default
| Default initialization.
| replace (v1::replace_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.
replace & | 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::document::view_or_value > const & | collation () const
| Retrieves the current collation for this operation.
replace & | collation (bsoncxx::v_noabi::document::view_or_value collation)
| Sets the collation for this operation.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const | comment () const
| Gets the current value of the comment option.
replace & | comment (bsoncxx::v_noabi::types::bson_value::view_or_value comment)
| Set the value of the comment option.
bsoncxx::v_noabi::stdx::optional< v_noabi::hint > const & | hint () const
| Gets the current hint.
replace & | hint (v_noabi::hint index_hint)
| Sets the index to use for this operation.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const | let () const
| Gets the current value of the let option.
replace & | let (bsoncxx::v_noabi::document::view_or_value let)
| Set the value of the let option.
| operator v1::replace_one_options () const
| Convert to the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > const & | read_concern () const
| The current read_concern for this operation.
replace & | read_concern (v_noabi::read_concern rc)
| Sets the read_concern for this operation.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & | sort () const
| Get the current value of the sort option.
replace & | sort (bsoncxx::v_noabi::document::view_or_value sort)
| Set the sort option.
bsoncxx::v_noabi::stdx::optional< bool > const & | upsert () const
| Gets the current value of the upsert option.
replace & | upsert (bool upsert)
| Sets the upsert option.
bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > const & | write_concern () const
| The current write_concern for this operation.
replace & | write_concern (v_noabi::write_concern wc)
| Sets the write_concern for this operation.

## Constructor & Destructor Documentation

## replace() [1/2]

mongocxx::v_noabi::options::replace::replace | ( |  | ) |

default

Default initialization.

## replace() [2/2]

mongocxx::v_noabi::options::replace::replace | ( | v1::replace_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::replace::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]

replace & mongocxx::v_noabi::options::replace::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.

## collation() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & mongocxx::v_noabi::options::replace::collation | ( |  | ) | const

inline

Retrieves the current collation for this operation.

Returns
  The current collation.

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

## collation() [2/2]

replace & mongocxx::v_noabi::options::replace::collation | ( | bsoncxx::v_noabi::document::view_or_value | collation | ) |

inline

Sets the collation for this operation.

Parameters

  collation | The new collation.

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/collation/

## comment() [1/2]

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

inline

Gets the current value of the comment option.

Returns
  The current comment option.

## comment() [2/2]

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

inline

Set the value of the comment option.

Parameters

  comment | The new comment option.

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

## hint() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::hint > const & mongocxx::v_noabi::options::replace::hint | ( |  | ) | const

inline

Gets the current hint.

Returns
  The current hint, if one is set.

## hint() [2/2]

replace & mongocxx::v_noabi::options::replace::hint | ( | v_noabi::hint | index_hint | ) |

inline

Sets the index to use for this operation.

Note
  if the server already has a cached shape for this query, it may ignore a hint.

Parameters

  index_hint | Object representing the index to use.

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

## let() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const mongocxx::v_noabi::options::replace::let | ( |  | ) | const

inline

Gets the current value of the let option.

Returns
  The current let option.

## let() [2/2]

replace & mongocxx::v_noabi::options::replace::let | ( | bsoncxx::v_noabi::document::view_or_value | let | ) |

inline

Set the value of the let option.

Parameters

  let | The new let option.

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

## operator v1::replace_one_options()

mongocxx::v_noabi::options::replace::operator v1::replace_one_options | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

## read_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > const & mongocxx::v_noabi::options::replace::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]

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

inline

Sets the read_concern for this operation.

Parameters

  rc | The new read_concern

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/read-concern/

## sort() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & mongocxx::v_noabi::options::replace::sort | ( |  | ) | const

inline

Get the current value of the sort option.

## sort() [2/2]

replace & mongocxx::v_noabi::options::replace::sort | ( | bsoncxx::v_noabi::document::view_or_value | sort | ) |

inline

Set the sort option.

## upsert() [1/2]

bsoncxx::v_noabi::stdx::optional< bool > const & mongocxx::v_noabi::options::replace::upsert | ( |  | ) | const

inline

Gets the current value of the upsert option.

Returns
  The optional value of the upsert option.

## upsert() [2/2]

replace & mongocxx::v_noabi::options::replace::upsert | ( | bool | upsert | ) |

inline

Sets the upsert option.

By default, if no document matches the filter, the replace operation does nothing. However, by specifying upsert as `true`, this operation either updates matching documents or inserts a new document using the replace specification if no matching document exists.

Parameters

  upsert | If set to `true`, creates a new document when no document matches the query criteria. The server-side default is `false`, which does not insert a new document if a match is not found.

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::replace::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]

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

inline

Sets the write_concern for this operation.

Parameters

  wc | The new write_concern

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/core/write-concern/

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

- mongocxx/v_noabi/mongocxx/options/replace.hpp