mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-15 21:03:30 +00:00
UBERF-4356 (#4521)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
896ac1172b
commit
94c6f8d158
@ -672,18 +672,29 @@ export class LiveQuery extends TxProcessor implements Client {
|
|||||||
space: tx.objectSpace
|
space: tx.objectSpace
|
||||||
}
|
}
|
||||||
|
|
||||||
TxProcessor.updateDoc2Doc(doc, tx)
|
// we cannot handle $inc correctly, let's skip it
|
||||||
|
const { $inc, ...ops } = tx.operations
|
||||||
|
|
||||||
let matched = false
|
const emptyOps = Object.keys(ops).length === 0
|
||||||
for (const key in q.query) {
|
let matched = emptyOps
|
||||||
const value = (q.query as any)[key]
|
if (!emptyOps) {
|
||||||
const tkey = checkMixinKey(key, q._class, this.client.getHierarchy())
|
const virtualTx = {
|
||||||
if ((doc as any)[tkey] === undefined) continue
|
...tx,
|
||||||
const res = findProperty([doc], tkey, value)
|
operations: ops
|
||||||
if (res.length === 0) {
|
}
|
||||||
return false
|
|
||||||
} else {
|
TxProcessor.updateDoc2Doc(doc, virtualTx)
|
||||||
matched = true
|
|
||||||
|
for (const key in q.query) {
|
||||||
|
const value = (q.query as any)[key]
|
||||||
|
const tkey = checkMixinKey(key, q._class, this.client.getHierarchy())
|
||||||
|
if ((doc as any)[tkey] === undefined) continue
|
||||||
|
const res = findProperty([doc], tkey, value)
|
||||||
|
if (res.length === 0) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
matched = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user