DittoSharp  0.1.0-alpha3
Public Member Functions | List of all members
DittoSharp.DittoCollection Class Reference

Public Member Functions

DittoPendingCursorOperation Find (string query)
 Creates a cursor for the documents in this collection that match the provided query. More...
 
DittoPendingCursorOperation FindAll ()
 Creates a cursor for all of the documents in this collection. More...
 
DittoPendingIDSpecificOperation FindById (string id)
 Creates an accessor for a single document by its unique identifier. More...
 
unsafe string Insert (Dictionary< string, object > data, string id=null, bool isDefault=false)
 Inserts a document into a collection. More...
 
unsafe DittoAttachment NewAttachment (string path, Dictionary< string, string > metadata=null)
 
DittoAttachmentFetcher FetchAttachment (DittoAttachmentToken token, Action< DittoAttachmentStatus > onStatusChanged)
 

Member Function Documentation

◆ Find()

DittoPendingCursorOperation DittoSharp.DittoCollection.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()

DittoPendingCursorOperation DittoSharp.DittoCollection.FindAll ( )
inline

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

Returns
A cursor for all documents in the collection.

◆ FindById()

DittoPendingIDSpecificOperation DittoSharp.DittoCollection.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.DittoCollection.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.