Fix aggregate group id (#5994)
* Fix aggregate group id * Improve implementation * Add test case * Fix postgres test - it does not work with group and sort at same time
This commit is contained in:
committed by
GitHub
parent
5a482bd661
commit
ac353ca8c2
@@ -799,7 +799,12 @@ export class MongoStorageAdapter implements StorageAdapter {
|
||||
if (isPointerField && result._id) {
|
||||
result._id = result._id.split('$')[1];
|
||||
}
|
||||
if (result._id == null || _.isEmpty(result._id)) {
|
||||
if (
|
||||
result._id == null ||
|
||||
result._id == undefined ||
|
||||
(['object', 'string'].includes(typeof result._id) &&
|
||||
_.isEmpty(result._id))
|
||||
) {
|
||||
result._id = null;
|
||||
}
|
||||
result.objectId = result._id;
|
||||
|
||||
Reference in New Issue
Block a user