Collection class Core
Exposes the operations which are available to be performed against a collection.
Namely the ability to perform Key-Value operations.
Constructors
- Collection.new({required String name, required Scope scope})
Properties
Methods
-
exists(
String key, [ExistsOptions? options]) → Future< ExistsResult> - Checks whether a document exists or not.
-
get(
String key, [GetOptions? options]) → Future< GetResult> - Retrieves the value of a document from the collection.
-
getAllReplicas(
String key, [GetAllReplicasOptions? options]) → Future< List< GetReplicaResult> > - Retrieves the value of the document from all available replicas.
-
getAndLock(
String key, Duration lockTime, [GetAndLockOptions? options]) → Future< GetResult> - Locks a document and retrieves the value of that document at the time it is locked.
-
getAndTouch(
String key, Duration expiry, [GetAnyReplicaOptions? options]) → Future< GetResult> - Retrieves the value of the document and simultaneously updates the expiry time for the same document.
-
getAnyReplica(
String key, [GetAnyReplicaOptions? options]) → Future< GetReplicaResult> - Retrieves the value of the document from any of the available replicas.
-
insert(
String key, Object? value, [InsertOptions? options]) → Future< MutationResult> - Inserts a new document into the collection, failing if the document already exists.
-
lookupIn(
String key, List< LookupInSpec> specs, [UnlockOptions? options]) → Future<LookupInResult> - Performs a Lookup-In operation against a document, fetching individual fields or information about specific fields inside the document value.
-
mutateIn(
String key, List< MutateInSpec> specs, [MutateInOptions? options]) → Future<MutateInResult> - Performs a Mutate-In operation against a document.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String key, [RemoveOptions? options]) → Future< MutationResult> - Remove an existing document from the collection.
-
replace(
String key, Object? value, [ReplaceOptions? options]) → Future< MutationResult> - Replaces the value of an existing document.
-
toString(
) → String -
A string representation of this object.
inherited
-
touch(
String key, Duration expiry, [TouchOptions? options]) → Future< MutationResult> - Updates the expiry on an existing document.
-
unlock(
String key, Cas cas, [UnlockOptions? options]) → Future< void> - Unlocks a previously locked document.
-
upsert(
String key, Object? value, [UpsertOptions? options]) → Future< MutationResult> - Upserts a document into the collection.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited