Merge pull request #17926 from overleaf/jpa-batched-update-sorting

[web] batchedUpdate: use explicit sorting to find first record to update

GitOrigin-RevId: 6f57b92a4e5907f307618bd98642b4874018e9fa
This commit is contained in:
Jakob Ackermann
2024-04-17 08:04:09 +00:00
committed by Copybot
parent ac2ea9f34d
commit 3df0fe82ce
2 changed files with 39 additions and 0 deletions
@@ -107,6 +107,7 @@ async function getIdEdgePast(collection) {
const [first] = await collection
.find({})
.project({ _id: 1 })
.sort({ _id: 1 })
.limit(1)
.toArray()
if (!first) return null