mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-17 13:54:11 +00:00
Qfix for lookup (#5515)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
3cbec84e5b
commit
381166ed87
@ -85,9 +85,9 @@ export class LookupMiddleware extends BaseMiddleware implements Middleware {
|
|||||||
newResult.push(newDoc)
|
newResult.push(newDoc)
|
||||||
for (const [k, v] of Object.entries(d.$lookup)) {
|
for (const [k, v] of Object.entries(d.$lookup)) {
|
||||||
if (!Array.isArray(v)) {
|
if (!Array.isArray(v)) {
|
||||||
newDoc.$lookup[k] = mapDoc(v)
|
newDoc.$lookup[k] = v != null ? mapDoc(v) : v
|
||||||
} else {
|
} else {
|
||||||
newDoc.$lookup[k] = v.map((it) => mapDoc(it))
|
newDoc.$lookup[k] = v.map((it) => (it != null ? mapDoc(it) : it))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user