mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 19:44:59 +03:00
TSK-1248: revert changes and add check for unset field (#3054)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
c1fac81f50
commit
faf6c4b055
@ -1063,7 +1063,7 @@ function fillDateSort (key: string, pipeline: any[], sort: any, options: FindOpt
|
||||
}
|
||||
pipeline.push({
|
||||
$addFields: {
|
||||
[`sort_isNull_${key}`]: { [key]: null }
|
||||
[`sort_isNull_${key}`]: { $or: [{ $eq: [`$${key}`, null] }, { $eq: [{ $type: `$${key}` }, 'missing'] }] }
|
||||
}
|
||||
})
|
||||
sort[`sort_isNull_${key}`] = options.sort[_key] === SortingOrder.Ascending ? 1 : -1
|
||||
|
Loading…
Reference in New Issue
Block a user