Skip to content

bpmn-server / IDocumentStore

Interface: IDocumentStore#

Implemented by#

Table of contents#

Methods#

Methods#

find#

▸ find(database, collection, query, projection?, sort?): Promise\<any[]>

Documents of collection matching query, projected and sorted. database names the logical database (MongoDB's db name; ignored by single-database adapters).

Parameters#

Name Type
database string
collection string
query StorageQuery
projection? Record\<string, any>
sort? Record\<string, -1 | 1>

Returns#

Promise\<any[]>

Defined in#

packages/bpmn-server/src/interfaces/storage.ts:18


count#

▸ count(database, collection, query): Promise\<number>

How many documents of collection match query. Optional: without it, callers count what find returns.

Parameters#

Name Type
database string
collection string
query StorageQuery

Returns#

Promise\<number>

Defined in#

packages/bpmn-server/src/interfaces/storage.ts:20


insert#

▸ insert(database, collection, documents): Promise\<number>

Inserts all of documents, or none: a unique-index conflict throws a DuplicateKeyError; any other failure throws as it is. Returns how many were inserted.

Parameters#

Name Type
database string
collection string
documents any[]

Returns#

Promise\<number>

Defined in#

packages/bpmn-server/src/interfaces/storage.ts:22


update#

▸ update(database, collection, query, update, options?): Promise\<number>

Updates the first document matching query ($set fields, or replaces it); { upsert: true } inserts when none matches. Returns how many were modified.

Parameters#

Name Type
database string
collection string
query StorageQuery
update Record\<string, any>
options? Object
options.upsert? boolean

Returns#

Promise\<number>

Defined in#

packages/bpmn-server/src/interfaces/storage.ts:24


remove#

▸ remove(database, collection, query): Promise\<{ deletedCount: number }>

Removes every document matching query; returns { deletedCount }.

Parameters#

Name Type
database string
collection string
query StorageQuery

Returns#

Promise\<{ deletedCount: number }>

Defined in#

packages/bpmn-server/src/interfaces/storage.ts:26


createIndex#

▸ createIndex(database, collection, index, options?): Promise\<string>

Declares an index; { unique: true } makes insert refuse a second document with the same values. Idempotent.

Parameters#

Name Type
database string
collection string
index Record\<string, -1 | 1>
options? Object
options.unique? boolean

Returns#

Promise\<string>

Defined in#

packages/bpmn-server/src/interfaces/storage.ts:28


close#

▸ close(): Promise\<void>

Releases connections. Idempotent.

Returns#

Promise\<void>

Defined in#

packages/bpmn-server/src/interfaces/storage.ts:30

Comments