Ditto  1.0.1
Public Member Functions | List of all members
DittoSDK.DittoDocumentID Class Reference

An identifier for a DittoDocument More...

Public Member Functions

 DittoDocumentID (object value)
 Initializes a new instance of the DittoDocumentID class. More...
 
override bool Equals (object other)
 Returns whether or not two DittoDocumentIDs are equal. More...
 
override int GetHashCode ()
 
unsafe override string ToString ()
 Returns a stringified representation of a document identifier. More...
 
object ToNative ()
 Returns a native representation of a document identifier. More...
 

Detailed Description

An identifier for a DittoDocument

Each DittoDocumentID represents a unique identifier for a document.

Constructor & Destructor Documentation

◆ DittoDocumentID()

DittoSDK.DittoDocumentID.DittoDocumentID ( object  value)
inline

Initializes a new instance of the DittoDocumentID class.

A document ID can be created from any of the following:

  • string
  • integer
  • boolean
  • null
  • byte array
  • array (containing any of the items in this list)
  • map (where the keys must be strings and the values can be made up of any of the items in this list)

Note that you cannot use floats or other custom types to create a document ID.

Document IDs are also limited in size, based on their serialized representation, to 256 bytes. You will receive an error if you try to create a document ID that exceeds the size limit.

Parameters
valueThe value that represents the document identifier.

Member Function Documentation

◆ Equals()

override bool DittoSDK.DittoDocumentID.Equals ( object  other)
inline

Returns whether or not two DittoDocumentIDs are equal.

Parameters
otherThe other DittoDocumentID to compare against for equality.
Returns
A bool denoting whether or not the DittoDocumentIDs were equal.

◆ ToNative()

object DittoSDK.DittoDocumentID.ToNative ( )
inline

Returns a native representation of a document identifier.

Returns
A value representing the document identifier.

◆ ToString()

unsafe override string DittoSDK.DittoDocumentID.ToString ( )
inline

Returns a stringified representation of a document identifier.

The returned string can be used directly in queries that you use with other Ditto functions. For example you could create a query that was like this:

myCollection.find($"_id == {docID.ToString()}")

Returns
An stringified representation of the document identifier.