Ditto  1.0.14
Public Member Functions | List of all members
ditto::Store Class Reference

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

Public Member Functions

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

Detailed Description

Provides access to Collections and a write transaction API.

Member Function Documentation

◆ collection()

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

Returns a Collection with the provided name.

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

◆ collections()

PendingCollectionsOperation ditto::Store::collections ( )

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

◆ write()

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

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.