mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 04:08:19 +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
|
||||
}
|
||||
|
||||
TxProcessor.updateDoc2Doc(doc, tx)
|
||||
// we cannot handle $inc correctly, let's skip it
|
||||
const { $inc, ...ops } = tx.operations
|
||||
|
||||
let matched = false
|
||||
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
|
||||
const emptyOps = Object.keys(ops).length === 0
|
||||
let matched = emptyOps
|
||||
if (!emptyOps) {
|
||||
const virtualTx = {
|
||||
...tx,
|
||||
operations: ops
|
||||
}
|
||||
|
||||
TxProcessor.updateDoc2Doc(doc, virtualTx)
|
||||
|
||||
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