The name of the collection.
The store this collection belongs to.
Generates a PendingCursorOperation using the provided query.
The returned object can be used to find and return the documents or you can
chain a call to observe
or subscribe
if you want to get updates about
the list of matching documents over time. It can also be used to update,
remove or evict the matching documents.
You can incorporate dynamic data into the query string with placeholders
in the form of $args.my_arg_name
, along with providing an accompanying
dictionary in the form of { "my_arg_name": "some value" }
.
The placeholders will be appropriately replaced by the corresponding
argument contained in queryArgs
. This includes handling things like
wrapping strings in quotation marks and arrays in square brackets, for
example.
The query to run against the collection.
The arguments to use to replace placeholders in the provided query.
Convenience method, equivalent to calling find() and passing
the query "true"
.
Generates a PendingIDSpecificOperation with the provided document ID.
The returned object can be used to find and return the document or you can chain a call to observe(), or subscribe() if you want to get updates about the document over time. It can also be used to update, remove or evict the document.
The ID of the document to find.
Inserts a new document into the collection and returns its ID.
The ID to use for the document. If null
or undefined
then Ditto will automatically generate an ID.
Whether or not the data being inserted should be
treated as default data. Set this to true
if you want to set a default
value that you expect to be overwritten by other devices in the network.
The default value is false
.
The data for the new document to insert.
Represents a collection of a Ditto store.
This is the entrypoint for inserting documents into a collection, as well as querying a collection. You can get a collection by calling collection() on a Store of a Ditto object.