Fix limit in nested a2o queries (#16435)

* Set the limit into the correct query for a2o

* Revert -1 limit and set foreignIds size as limit
This commit is contained in:
ian
2022-11-14 22:41:36 +08:00
committed by GitHub
parent 6cf77668d1
commit 4dfc00cf74

View File

@@ -306,7 +306,7 @@ function applyParentFilters(
const foreignIds = uniq(keysPerCollection[relatedCollection]);
merge(nestedNode, {
query: { [relatedCollection]: { filter: { [foreignField]: { _in: foreignIds } } } },
query: { [relatedCollection]: { filter: { [foreignField]: { _in: foreignIds } }, limit: foreignIds.length } },
});
}
}