userver: storages::mongo::operations::Bulk Class Reference
Loading...
Searching...
No Matches
storages::mongo::operations::Bulk Class Reference

#include <userver/storages/mongo/bulk.hpp>

Detailed Description

Efficiently executes a number of operations over a single collection.

Definition at line 19 of file bulk.hpp.

Public Types

enum class  Mode {
  kOrdered ,
  kUnordered
}
 

Public Member Functions

 Bulk (Mode)
 
 Bulk (const Bulk &)=delete
 
 Bulk (Bulk &&) noexcept
 
Bulkoperator= (const Bulk &)=delete
 
Bulkoperator= (Bulk &&) noexcept
 
bool IsEmpty () const
 
void SetOption (options::WriteConcern::Level)
 
void SetOption (const options::WriteConcern &)
 
void SetOption (options::SuppressServerExceptions)
 
template<typename... Options>
void InsertOne (formats::bson::Document document, Options &&... options)
 Inserts a single document.
 
template<typename... Options>
void ReplaceOne (formats::bson::Document selector, formats::bson::Document replacement, Options &&... options)
 Replaces a single matching document.
 
template<typename... Options>
void UpdateOne (formats::bson::Document selector, formats::bson::Document update, Options &&... options)
 Updates a single matching document.
 
template<typename... Options>
void UpdateMany (formats::bson::Document selector, formats::bson::Document update, Options &&... options)
 Updates all matching documents.
 
template<typename... Options>
void DeleteOne (formats::bson::Document selector, Options &&... options)
 Deletes a single matching document.
 
template<typename... Options>
void DeleteMany (formats::bson::Document selector, Options &&... options)
 Deletes all matching documents.
 
Prepared sub-operation inserters
void Append (const bulk_ops::InsertOne &)
 
void Append (const bulk_ops::ReplaceOne &)
 
void Append (const bulk_ops::Update &)
 
void Append (const bulk_ops::Delete &)
 

Member Enumeration Documentation

◆ Mode

enum class storages::mongo::operations::Bulk::Mode
strong

Definition at line 21 of file bulk.hpp.

Member Function Documentation

◆ DeleteMany()

template<typename... Options>
void storages::mongo::operations::Bulk::DeleteMany ( formats::bson::Document selector,
Options &&... options )

Deletes all matching documents.

Definition at line 118 of file bulk.hpp.

◆ DeleteOne()

template<typename... Options>
void storages::mongo::operations::Bulk::DeleteOne ( formats::bson::Document selector,
Options &&... options )

Deletes a single matching document.

Definition at line 111 of file bulk.hpp.

◆ InsertOne()

template<typename... Options>
void storages::mongo::operations::Bulk::InsertOne ( formats::bson::Document document,
Options &&... options )

Inserts a single document.

Definition at line 83 of file bulk.hpp.

◆ ReplaceOne()

template<typename... Options>
void storages::mongo::operations::Bulk::ReplaceOne ( formats::bson::Document selector,
formats::bson::Document replacement,
Options &&... options )

Replaces a single matching document.

See also
options::Upsert

Definition at line 90 of file bulk.hpp.

◆ UpdateMany()

template<typename... Options>
void storages::mongo::operations::Bulk::UpdateMany ( formats::bson::Document selector,
formats::bson::Document update,
Options &&... options )

Updates all matching documents.

See also
options::Upsert

Definition at line 104 of file bulk.hpp.

◆ UpdateOne()

template<typename... Options>
void storages::mongo::operations::Bulk::UpdateOne ( formats::bson::Document selector,
formats::bson::Document update,
Options &&... options )

Updates a single matching document.

See also
options::Upsert

Definition at line 97 of file bulk.hpp.


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