import { KeyworkDocumentReference } from "https://deno.land/x/keywork@v6.0.1/collections/mod.ts";
Creates an instance associated with specific document within a Cloudflare KV.
Constructors
new
KeyworkDocumentReference(kvNamespace: KVNamespace,
relativeDocPath: string,
parentCollection?: KeyworkCollection<ExpectedType>,
Type Parameters
optional
ExpectedType extends DeserializationTypes | { } = neverMethods
fetchSnapshot(options?: KeyworkDocumentFetchOptions): Promise<KeyworkDocumentSnapshot<ExpectedType>>
Attempts to fetch a KeyworkDocumentSnapshot
associated with the docPath
.
If the deserializeAs
option is not set,
the type will attempt to be inferred from the parent collection's known metadata.
patchValue<E = ExpectedType>()
nextValue: Partial<E>,
options?: PutOrPatchOptions,
snapshot?: KeyworkDocumentSnapshot<E>,
deepMergeOptions?: any,
Updates the data associated with this document's path.
putValue<E = ExpectedType>(nextValue: Partial<E>, putOptions?: PutOrPatchOptions)
Overwrites the entire entity if it already exists, and creates a new resource if it doesn’t exist.