SyncCollection class abstract interface Database

A Collection with a primarily synchronous API.

Inheritance

Properties

count int
The total number of documents in this collection.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
indexes List<String>
The names of all existing indexes for this collection.
no setteroverride
name String
The name of this collection.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scope SyncScope
The Scope this collection belongs to.
no setteroverride

Methods

addChangeListener(CollectionChangeListener listener) ListenerToken
Adds a listener to be notified of all changes to Documents in this collection.
override
addDocumentChangeListener(String id, DocumentChangeListener listener) ListenerToken
Adds a listener to be notified of changes to the Document with the given id.
override
changes() Stream<CollectionChange>
Returns a Stream to be notified of all changes to Documents in this collection.
inherited
createIndex(String name, Index index) → void
Creates a value or full-text search index with the given name for the documents in this collection.
override
deleteDocument(Document document, [ConcurrencyControl concurrencyControl = ConcurrencyControl.lastWriteWins]) bool
Deletes a document from this collection, resolving conflicts through ConcurrencyControl.
override
deleteIndex(String name) → void
Deletes the Index of the given name.
override
document(String id) Document?
Returns the Document with the given id, if it exists.
override
documentChanges(String id) Stream<DocumentChange>
Returns a Stream to be notified of changes to the Document with the given id.
inherited
getDocumentExpiration(String id) DateTime?
Gets the expiration date of a Document by its id, if it exists.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
purgeDocument(Document document) → void
Purges a document from this collection.
override
purgeDocumentById(String id) → void
Purges a Document from this collection by its id.
override
removeChangeListener(ListenerToken token) → void
Removes a previously added change listener.
override
saveDocument(MutableDocument document, [ConcurrencyControl concurrencyControl = ConcurrencyControl.lastWriteWins]) bool
Saves a document to this collection, resolving conflicts through ConcurrencyControl.
override
saveDocumentWithConflictHandler(MutableDocument document, SaveConflictHandler conflictHandler) FutureOr<bool>
Saves a document to this collection, resolving conflicts with a conflictHandler.
inherited
saveDocumentWithConflictHandlerSync(MutableDocument document, SyncSaveConflictHandler conflictHandler) bool
Saves a document to this database, resolving conflicts with an sync conflictHandler.
setDocumentExpiration(String id, DateTime? expiration) → void
Sets an expiration date for a Document by its id.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String id) DocumentFragment
Returns the DocumentFragment for the Document with the given id.
override