An identifier for a DittoDocument
More...
|
object | Value [get] |
| Gets the underlying value of the document identifier as a native type.
|
|
DittoDocumentIDPath | this[string path] [get] |
| Used to specify a path to a key in the document ID that you can subscript further to access a nested key in the document ID, if necessary. More...
|
|
DittoDocumentIDPath | this[int index] [get] |
| Used to specify an index in the array that represents the document ID. You can subscript the return value further to access a further nested key in the document ID, if necessary. More...
|
|
An identifier for a DittoDocument
Each DittoDocumentID
represents a unique identifier for a document.
◆ 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
-
value | The value that represents the document identifier. |
◆ Equals()
override bool DittoSDK.DittoDocumentID.Equals |
( |
object |
other | ) |
|
|
inline |
◆ ToNative()
object DittoSDK.DittoDocumentID.ToNative |
( |
| ) |
|
|
inline |
Returns a native representation of a document identifier.
- Returns
- A value representing the document identifier.
◆ ToString()
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.
◆ this[int index]
Used to specify an index in the array that represents the document ID. You can subscript the return value further to access a further nested key in the document ID, if necessary.
- Parameters
-
index | The index of the array representing the document ID that you wish to access. |
- Returns
- A
DITDocumentIDPath
object with the provided index incorporated into the document ID path.
◆ this[string path]
Used to specify a path to a key in the document ID that you can subscript further to access a nested key in the document ID, if necessary.
- Parameters
-
path | The initial part of the path needed to get to the key in the document ID you wish to get the value of. |
- Returns
- A
DittoDocumentIDPath
object with the provided key incorporated into the document ID path.