LiveQuery should match subobjects with dot notation (#3322)
* LiveQuery should match subobjects with dot notation * one additional test case
This commit is contained in:
committed by
Arthur Cinader
parent
edba550cf6
commit
df029b82eb
@@ -133,6 +133,13 @@ function matchesKeyConstraints(object, key, constraints) {
|
||||
if (constraints === null) {
|
||||
return false;
|
||||
}
|
||||
if(key.indexOf(".") >= 0){
|
||||
// Key references a subobject
|
||||
var keyComponents = key.split(".");
|
||||
var subObjectKey = keyComponents[0];
|
||||
var keyRemainder = keyComponents.slice(1).join(".");
|
||||
return matchesKeyConstraints(object[subObjectKey] || {}, keyRemainder, constraints);
|
||||
}
|
||||
var i;
|
||||
if (key === '$or') {
|
||||
for (i = 0; i < constraints.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user