Platform Manual
Document Model
Collections
at a high level, ditto queries execute on specific collections and are utilized to filter and narrow down the contents of those collections a collection is a set of documents categorized together for example, you would group all documents related to cars in a "cars" collection creating a collection using ditto store collection and upsert methods, create your collection for example, cars for more information, see docid 1cexfnswhjeqa r6yyl 8 pseudocode ditto store collection("cars") upsert({ id 123, make "toyota", model "corolla", year 2022, color "blue" }); referencing a collection instead of inspecting the many fields that documents contain, you can reference a shared collection making it easy to retrieve and store information ditto syncs and queries documents using a combination of collection name and document identifier the document id serves as the primary identifier within the collection as long as a collection contains at least one document, you can continue referencing it following is an example of a reference to cars in a replication query using the find method pseudocode const collection = await ditto store collection('cars') find("color == 'red' && mileage <=5000")