DittoSyncKit  1.0.0-alpha1
Public Member Functions | Properties | List of all members
Ditto.SyncKit.DittoScopedWriteTransaction Class Reference

Exposes functionality that allows you to perform multiple operations on the store within a single write transaction. More...

Public Member Functions

unsafe string Insert (Dictionary< string, object > data, string id=null, bool isDefault=false)
 Inserts a document into a collection. More...
 
DittoWriteTransactionPendingCursorOperation Find (string query)
 Creates a cursor for the documents in this collection that match the provided query. More...
 
DittoWriteTransactionPendingCursorOperation FindAll ()
 Creates a cursor for all of the documents in this collection. More...
 
DittoWriteTransactionPendingIDSpecificOperation FindById (string id)
 Creates an accessor for a single document by its unique identifier. More...
 

Properties

string CollectionName [get]
 Gets the name of the collection that the scoped write transaction is scoped to. More...
 

Detailed Description

Exposes functionality that allows you to perform multiple operations on the store within a single write transaction.

A DittoScopedWriteTransaction is scoped to a specific collection, obtained by calling DittoWriteTransaction.Scoped(string).

Member Function Documentation

◆ Find()

DittoWriteTransactionPendingCursorOperation Ditto.SyncKit.DittoScopedWriteTransaction.Find ( string  query)
inline

Creates a cursor for the documents in this collection that match the provided query.

Parameters
queryA ditto query string.
Returns
A cursor for the query.

◆ FindAll()

DittoWriteTransactionPendingCursorOperation Ditto.SyncKit.DittoScopedWriteTransaction.FindAll ( )
inline

Creates a cursor for all of the documents in this collection.

Returns
A cursor for all documents in the collection.

◆ FindById()

DittoWriteTransactionPendingIDSpecificOperation Ditto.SyncKit.DittoScopedWriteTransaction.FindById ( string  id)
inline

Creates an accessor for a single document by its unique identifier.

Parameters
idThe id of the document in this collection.
Returns
A cursor for a single document.

◆ Insert()

unsafe string Ditto.SyncKit.DittoScopedWriteTransaction.Insert ( Dictionary< string, object >  data,
string  id = null,
bool  isDefault = false 
)
inline

Inserts a document into a collection.

Parameters
dataThe document content.
idThe primary key or identifier for this document. If this is null then DittoSyncKit will assign it a unique identifier. This cannot be changed once inserted.
isDefaultSet to true if the document should assume all values are default. See https://docs.ditto.live/concepts/data-model.
Returns
The unique identifier of the document.

Property Documentation

◆ CollectionName

string Ditto.SyncKit.DittoScopedWriteTransaction.CollectionName
get

Gets the name of the collection that the scoped write transaction is scoped to.