Class Publisher<TMessage>

Type Parameters

  • TMessage extends Document

Constructors

Methods

Constructors

Methods

  • Publishes the given message, returning the inserted message ID. Ignores message duplicates, returning null in that case. Can be used inside transactions (same options as MongoDB insertOne).

    Parameters

    • message: OptionalUnlessRequiredId<TMessage>
    • Optionaloptions: InsertOneOptions

    Returns Promise<null | InferIdType<TMessage>>