Loading...
Searching...
No Matches
mongocxx::v1::bulk_write::replace_one Class Reference

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

## Description

A single "Replace One" write operation.

Supported fields include:

- collation
- filter
- hint
- replacement
- sort
- upsert

See also
  - Bulk Write Operations (MongoDB Manual)

## Public Member Functions

| replace_one (bsoncxx::v1::document::value filter, bsoncxx::v1::document::value replacement)
| Initialize with the given "filter" and "replacement" documents.
| replace_one (replace_one &&other) noexcept
| Move constructor.
| replace_one (replace_one const &other)
| Copy construction.
| ~replace_one ()
| Destroy this object.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > | collation () const
| Return the current "collation" field.
replace_one & | collation (bsoncxx::v1::document::value v)
| Set the "collation" field.
bsoncxx::v1::document::view | filter () const
| Return the current "filter" field.
bsoncxx::v1::stdx::optional< v1::hint > | hint () const
| Return the current "hint" field.
replace_one & | hint (v1::hint v)
| Set the "hint" field.
replace_one & | operator= (replace_one &&other) noexcept
| Move assignment.
replace_one & | operator= (replace_one const &other)
| Copy assignment.
bsoncxx::v1::document::view | replacement () const
| Return the current "replacement" field.
bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > | sort () const
| Return the current "sort" field.
replace_one & | sort (bsoncxx::v1::document::value v)
| Set the "sort" field.
bsoncxx::v1::stdx::optional< bool > | upsert () const
| Return the current "upsert" field.
replace_one & | upsert (bool v)
| Set the "upsert" field.

## Constructor & Destructor Documentation

## ~replace_one()

mongocxx::v1::bulk_write::replace_one::~replace_one | ( |  | ) |

Destroy this object.

Warning
  Invalidates all associated views.

## replace_one() [1/3]

mongocxx::v1::bulk_write::replace_one::replace_one | ( | replace_one && | other | ) |

noexcept

Move constructor.

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

## replace_one() [2/3]

mongocxx::v1::bulk_write::replace_one::replace_one | ( | replace_one const & | other | ) |

Copy construction.

## replace_one() [3/3]

mongocxx::v1::bulk_write::replace_one::replace_one | ( | bsoncxx::v1::document::value | filter,
|  | bsoncxx::v1::document::value | replacement )

Initialize with the given "filter" and "replacement" documents.

Postconditions:
  - All other supported fields are "unset" or zero-initialized.

## Member Function Documentation

## collation() [1/2]

bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > mongocxx::v1::bulk_write::replace_one::collation | ( |  | ) | const

Return the current "collation" field.

## collation() [2/2]

replace_one & mongocxx::v1::bulk_write::replace_one::collation | ( | bsoncxx::v1::document::value | v | ) |

Set the "collation" field.

## filter()

bsoncxx::v1::document::view mongocxx::v1::bulk_write::replace_one::filter | ( |  | ) | const

Return the current "filter" field.

## hint() [1/2]

bsoncxx::v1::stdx::optional< v1::hint > mongocxx::v1::bulk_write::replace_one::hint | ( |  | ) | const

Return the current "hint" field.

## hint() [2/2]

replace_one & mongocxx::v1::bulk_write::replace_one::hint | ( | v1::hint | v | ) |

Set the "hint" field.

## operator=() [1/2]

replace_one & mongocxx::v1::bulk_write::replace_one::operator= | ( | replace_one && | other | ) |

noexcept

Move assignment.

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

## operator=() [2/2]

replace_one & mongocxx::v1::bulk_write::replace_one::operator= | ( | replace_one const & | other | ) |

Copy assignment.

## replacement()

bsoncxx::v1::document::view mongocxx::v1::bulk_write::replace_one::replacement | ( |  | ) | const

Return the current "replacement" field.

## sort() [1/2]

bsoncxx::v1::stdx::optional< bsoncxx::v1::document::view > mongocxx::v1::bulk_write::replace_one::sort | ( |  | ) | const

Return the current "sort" field.

## sort() [2/2]

replace_one & mongocxx::v1::bulk_write::replace_one::sort | ( | bsoncxx::v1::document::value | v | ) |

Set the "sort" field.

## upsert() [1/2]

bsoncxx::v1::stdx::optional< bool > mongocxx::v1::bulk_write::replace_one::upsert | ( |  | ) | const

Return the current "upsert" field.

## upsert() [2/2]

replace_one & mongocxx::v1::bulk_write::replace_one::upsert | ( | bool | v | ) |

Set the "upsert" field.

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

- mongocxx/v1/bulk_write.hpp