Sanity Library Reference Docs
    Preparing search index...

    Class ObservableTransaction

    Index

    Constructors

    Methods

    • Commit the transaction, returning an observable that produces the first mutated document

      Type Parameters

      • R extends Record<string, any>

      Parameters

      • options: TransactionFirstDocumentMutationOptions

        Options for the mutation operation

      Returns Observable<SanityDocument<R>>

    • Commit the transaction, returning an observable that produces an array of the mutated documents

      Type Parameters

      • R extends Record<string, any>

      Parameters

      • options: TransactionAllDocumentsMutationOptions

        Options for the mutation operation

      Returns Observable<SanityDocument<R>[]>

    • Commit the transaction, returning an observable that produces a mutation result object

      Parameters

      • options: TransactionFirstDocumentIdMutationOptions

        Options for the mutation operation

      Returns Observable<SingleMutationResult>

    • Commit the transaction, returning an observable that produces a mutation result object

      Parameters

      • options: TransactionAllDocumentIdsMutationOptions

        Options for the mutation operation

      Returns Observable<MultipleMutationResult>

    • Commit the transaction, returning an observable that produces a mutation result object

      Parameters

      • Optionaloptions: BaseMutationOptions

        Options for the mutation operation

      Returns Observable<MultipleMutationResult>

    • Creates a new Sanity document. If _id is provided and already exists, the mutation will fail. If no _id is given, one will automatically be generated by the database. The operation is added to the current transaction, ready to be commited by commit()

      Type Parameters

      • R extends Record<string, any> = Record<string, any>

      Parameters

      Returns this