mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 04:08:19 +00:00
Remove extra lookup value (#1058)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
6e934b83aa
commit
c7bfa1b295
@ -240,10 +240,20 @@ abstract class MongoAdapterBase extends TxProcessor {
|
|||||||
for (const row of result) {
|
for (const row of result) {
|
||||||
row.$lookup = {}
|
row.$lookup = {}
|
||||||
await this.fillLookupValue(options.lookup, row)
|
await this.fillLookupValue(options.lookup, row)
|
||||||
|
this.clearExtraLookups(row)
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private clearExtraLookups (row: any): void {
|
||||||
|
for (const key in row) {
|
||||||
|
if (key.endsWith('_lookup')) {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
delete row[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private checkMixinKey<T extends Doc>(key: string, clazz: Ref<Class<T>>): string {
|
private checkMixinKey<T extends Doc>(key: string, clazz: Ref<Class<T>>): string {
|
||||||
if (!key.includes('.')) {
|
if (!key.includes('.')) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user