bpmn-server / DocumentPager
Class: DocumentPager#
The data store's paged search (DataStore.find) on any storage adapter: what the MongoDB
aggregation (Aggregate.ts) answers, computed from the documents the adapter finds.
filter: on the instance (name,data.x) and on its items (items.x); with an item filter, the answer has one entry per matching item,itemsbeing that item (MongoDB's$unwind).lastItem/latestItem: instead, one entry per instance, with its last item (byseq) or its latest ended item (byendedAt) matching the condition, underlastItem/latestItem.sort(one field,1or-1; default_iddescending),limit(10),projection.after: thenextCursorof the page before:<sort value>|<_id>(d:<ms>for a date), or the_id.getTotalCount: how many instances match the filter.
Table of contents#
Constructors#
Methods#
Constructors#
constructor#
• new DocumentPager(): DocumentPager
Returns#
Methods#
find#
▸ find(store, database, collection, «destructured»): Promise\<FindResult\<any>>
Parameters#
| Name | Type |
|---|---|
store |
IDocumentStore |
database |
string |
collection |
string |
«destructured» |
FindParams |
Returns#
Promise\<FindResult\<any>>
Defined in#
packages/bpmn-server/src/datastore/DocumentPager.ts:19
cursorOf#
▸ cursorOf(row, sortField, value): string
The cursor of a row: its sort value (a date as d:<ms>) and its _id.
Parameters#
| Name | Type |
|---|---|
row |
any |
sortField |
string |
value |
any |
Returns#
string
Defined in#
packages/bpmn-server/src/datastore/DocumentPager.ts:72
cursorRow#
▸ cursorRow(after, sortField): any
A row standing for a cursor, to compare the rows against.
Parameters#
| Name | Type |
|---|---|
after |
string |
sortField |
string |
Returns#
any
Defined in#
packages/bpmn-server/src/datastore/DocumentPager.ts:79