userver: storages::mongo::operations::Bulk Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
storages::mongo::operations::Bulk Class Reference

Efficiently executes a number of operations over a single collection. More...

#include <userver/storages/mongo/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 &)
 

Detailed Description

Efficiently executes a number of operations over a single collection.

Definition at line 19 of file bulk.hpp.

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 129 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 121 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 86 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 93 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 112 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 103 of file bulk.hpp.


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