DittoSharp  0.4.0-alpha2
Public Member Functions | Properties | List of all members
DittoSharp.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 DittoSharp.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 DittoSharp.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 DittoSharp.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 DittoSharp.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 DittoKit 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 DittoSharp.DittoScopedWriteTransaction.CollectionName
get

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