Replies: 9 comments 2 replies
-
Hello @kvdinker , |
Beta Was this translation helpful? Give feedback.
-
@ralphie2025 - thanks for your quick reply and great that you also like the proposal. I hope the additional details help. If you have any further questions, I will try to answer them as soon as possible. Thanks for your effort :) |
Beta Was this translation helpful? Give feedback.
-
Now available in Release 2.3.2 |
Beta Was this translation helpful? Give feedback.
-
Thank you :) It looks like a huge benefit for us. |
Beta Was this translation helpful? Give feedback.
-
Sorry, my bad, all done. |
Beta Was this translation helpful? Give feedback.
-
Hey @ralphhanna, |
Beta Was this translation helpful? Give feedback.
-
I see the problem, since we flattened the results, you can't have projection of 'items': 0 ,it will not return any results (may fix this later) Current ReleaseTry this as a workaround: filter: { name: 'Buy Used Car',"items.seq":1 },
sort: {"name":1},
projection: { id: 1, data: 1, name: 1, _id:1,startedAt:1,status:1, "items.dueDate":1, "items.type":1,"items.name":1,"items.status":1 items.seq":1} The trick here is to restrict only one item (seq==1) New Release 2.3.4 you can do this:filter: { name: 'Buy Used Car'},
sort: {"name":1},
projection: { id: 1, data: 1, name: 1, _id:1,startedAt:1,status:1} Will return only instances as long as you don't reference "items" in your filter, sort or projection |
Beta Was this translation helpful? Give feedback.
-
Hey @ralphhanna,
In combination with a custom sort ( data.customState: 1 or name: -1), I noticed that I get strange values from page 2 onwards. Several entries are repeated, others are no longer displayed and sometimes the number of entries does not match the limit. I have seen that the nextCursor looks different
This changes the aggregation internally (as far as I can see). Example
Converts to:
Results in (Page 2 Entries 6-10):
|
Beta Was this translation helpful? Give feedback.
-
Pagination requires sorting on a unique field, so we need to add '_id' to
the sort field
nextCursor should be;
- with sorting (Verfahren|679b2ca8e09cf450b4be4c9a or [object
Object]|67d1674eb74edf56bc412d7d)
- without (67f392fc67356225a8b5615c)
But `[object Object]|67d1674eb74edf56bc412d7d)` is a problem.. possible
invalid sort field...
I can't see what the problem in your scenario,
I suggest to examine the problem further that you run it first with very
large limit, say 500, and see if they are sorted OK,
…On Wed, Apr 23, 2025 at 8:35 AM kvdinker ***@***.***> wrote:
Hey @ralphhanna <https://github.com/ralphhanna>,
Thanks for the update :)
I had some time to update our code as well. Pagination with instances
works great. Also, I took a deeper look into filtering and found a good way
to add a “contains” filter due to aggregation. Here I could add a regex
expression like below:
filter: { name: { $regex: 'Used' }},
projection: { id: 1, data: 1, name: 1, _id:1,startedAt:1,status:1}
In combination with a custom sort ( data.customState: 1 or name: -1), I
noticed that I get strange values from page 2 onwards. Several entries are
repeated, others are no longer displayed and sometimes the number of
entries does not match the limit. I have seen that the nextCursor looks
different
- with sorting (Verfahren|679b2ca8e09cf450b4be4c9a or [object
Object]|67d1674eb74edf56bc412d7d)
- without (67f392fc67356225a8b5615c)
This changes the aggregation internally (as far as I can see).
Can you explain what is going on there and know how to fix it?
*Example*
FindParameters:
after: "Verfahren|679b2ca8e09cf450b4be4c9a"
filter: {name: 'Verfahren', status: 'end'}
getTotalCount: true
limit: 5
sort: {name: -1}
projection: { id: 1, data: 1, name: 1, _id:1,startedAt:1,status:1}
Converts to:
[
{
"$match": {
"name": "Verfahren",
"status": "end",
"$and": [
{
"$or": [
{
"name": {
"$lt": "Verfahren"
},
"_id": {
"$ne": "679b2ca8e09cf450b4be4c9a"
}
},
{
"name": "Verfahren",
"_id": {
"$lt": "679b2ca8e09cf450b4be4c9a"
}
}
]
}
]
}
},
{
"$project": {
"name": 1,
"id": 1,
"status": 1,
"data": 1,
"startedAt": 1
}
},
{
"$sort": {
"name": -1
}
},
{
"$limit": 5
}
]
Results in (Page 2 Entries 6-10):
{
"data": [
{
"_id": "679b2c3ce09cf450b4be4c96",
"id": "0118ed9e-7c15-46b7-bb08-0ad694beb85d",
"name": "Verfahren",
"status": "end",
"data": {},
"startedAt": "2025-01-30T07:37:30.996Z"
},
{
"_id": "679b2c95e09cf450b4be4c98",
"id": "4b27677e-2106-4e80-b953-c3366ecfe79b",
"name": "Verfahren",
"status": "end",
"data": {},
"startedAt": "2025-01-30T07:38:59.849Z"
}
],
"nextCursor": "Verfahren|679b2c95e09cf450b4be4c98",
"totalCount": 26
}
—
Reply to this email directly, view it on GitHub
<#247 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQL5NQ5F4IOUTMRCCFZVUI3226CEFAVCNFSM6AAAAABZPJF72KVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEOJSGI2TSMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello :)
We are currently working with your great workflow server tool to handle some business processes. Due to some long running instances we get more and more running processes which we want to display in a suitable way. For this we use the bpmn-client to retrieve all active and completed data and display it via a Next UI. Due to the amount of data, the query takes more and more time.
A great approach here would be to determine the amount of data ourselves using server-side pagination. This would allow you to limit the query time and process the data step by step.
Have you ever thought about such a feature?
It would be a huge help for us and probably many others. I look forward to hearing your thoughts on server-side pagination.
Thanks a lot
Beta Was this translation helpful? Give feedback.
All reactions