UNPKG

insite-db

Version:

MongoDB for inSite

20 lines 1.3 kB
import type { ChangeStreamListener, CollectionIndexes } from "../types"; declare module "mongodb" { interface Collection<TSchema> { /** Ensures the presence of `indexes`. */ ensureIndexes(indexes: CollectionIndexes): Promise<void>; /** Change Stream, watching for new changes in this collection. */ changeStream?: ChangeStream<TSchema>; /** Adds the `listener` function to the end of the listeners array for the event `change`. */ onChange?(listener: ChangeStreamListener<TSchema>): this; /** Adds the `listener` function to the *beginning* of the listeners array for the event `change`. */ prependChange?(listener: ChangeStreamListener<TSchema>): this; /** Adds the **one-time** `listener` function to the end of the listeners array for the event `change`. */ onceChange?(listener: ChangeStreamListener<TSchema>): this; /** Adds the **one-time** function to the *beginning* of the listeners array for the event `change`. */ prependOnceChange?(listener: ChangeStreamListener<TSchema>): this; /** Removes the `listener` from the listener array for the event `change`. */ removeChangeListener?(listener: ChangeStreamListener<TSchema>): this; } } //# sourceMappingURL=Collection.d.ts.map