UBERF-4356 (#4521)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-02-05 15:02:22 +06:00 committed by GitHub
parent 896ac1172b
commit 94c6f8d158
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}
} }
} }