Ditto 4.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ditto::Store Class Reference

Provides access to Collections and a write transaction API. More...

#include <Store.hpp>

Public Member Functions

Collection collection (std::string name) const
 Returns a Collection with the provided name.
 
std::vector< std::unique_ptr< WriteTransactionResult > > write (std::function< void(WriteTransaction &)> fn) const
 Allows you to group multiple operations together that affect multiple documents, potentially across multiple collections.
 
PendingCollectionsOperation collections () const
 Returns an object that lets you fetch or observe the collections in the store.
 
DiskUsage get_disk_usage () const
 Provides access to the Store's disk usage.
 

Detailed Description

Provides access to Collections and a write transaction API.

Member Function Documentation

◆ collection()

Collection ditto::Store::collection ( std::string  name) const

Returns a Collection with the provided name.

Parameters
[in]namethe name of the collection.
Returns
a Collection.

◆ collections()

PendingCollectionsOperation ditto::Store::collections ( ) const

Returns an object that lets you fetch or observe the collections in the store.

Returns
a PendingCollectionsOperation object that you can use to fetch or observe the collections in the store

◆ get_disk_usage()

DiskUsage ditto::Store::get_disk_usage ( ) const

Provides access to the Store's disk usage.

Returns
a DiskUsage object.

◆ write()

std::vector< std::unique_ptr< WriteTransactionResult > > ditto::Store::write ( std::function< void(WriteTransaction &)>  fn) const

Allows you to group multiple operations together that affect multiple documents, potentially across multiple collections.

Parameters
fna lambda that provides access to a write transaction object that can be used to perform operations on the store.
Returns
a list of WriteTransactionResults. There is a result for each operation performed as part of the write transaction.