@couchbase/lite-js
    Preparing search index...

    Interface DocumentMeta<D>

    The metadata of a document, such as its DocID; returned by the function meta. For example:

    const docID = meta(doc).id;
    
    interface DocumentMeta<D extends CBLDictLike<D>> {
        body: CBLDocument<D>;
        collection: Collection<D>;
        id: DocID;
        get revisionID(): RevID | undefined;
        get sequence(): Sequence | undefined;
        setBody(newBody: D): void;
    }

    Type Parameters

    • D extends CBLDictLike<D>

      The document schema; will be the same as in the CBLDocument argument to meta().

    Index

    Properties

    Accessors

    Methods

    Properties

    body: CBLDocument<D>

    The document itself.

    collection: Collection<D>

    The collection that the document belongs to.

    id: DocID

    The ID (primary key) of the document.

    Accessors

    • get revisionID(): RevID | undefined

      The current revision ID of the document.

      Returns RevID | undefined

    • get sequence(): Sequence | undefined

      The current sequence number of the document.

      Returns Sequence | undefined

    Methods

    • Replaces the document's properties with a copy of newBody.

      Parameters

      • newBody: D

      Returns void