You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add the follow code for TAFFY.has function before line "switch ( T.typeOf( var1 ) ){":
if(T.isObject(var2)){
let f = returnFilter(var2);
switch ( T.typeOf( var1 ) ) {
case 'array':
let found = false;
eachin( var1, function ( v, n ) {
if(found) return;
re = runFilters( v, f );
if(re){
found = true;
return TAFFY.EXIT;
}
});
break;
default:
re = runFilters( var1, f );
break;
}
return re;
}
the filter object : {'skus':{'has':{'tt': { 'has':{'aa': {'has':{'bb':{'gt': 0}}}}}}}}
the data object structure:[{"skus":[{"tt":{"aa":{"bb":1}}}]}];
in this case , the has/hasAll be used as a sub function
{'skus':{'has':{'tt': { 'has':{'aa':{'bb':1}}}}}} got same result without has, but with the fixed value
another place should be patch, in TAFFY.has function, and switch section:
if ( T.isObject( var2 ) ){
eachin( var2, function ( v, n ) {
if ( re === true && !T.isUndefined( var1[n] ) &&
change to :
if ( T.isObject( var2 ) ){
eachin( var2, function ( v, n ) {
if (!T.isUndefined( var1[n] ) &&
re === true condition maybe a bug, res always false in this place
I'm not able to view multiple levels of nested objects using TaffyDb.
I'm using the similar style as MongoDb.
let me know if this is already working, or it's an issue in general.
The text was updated successfully, but these errors were encountered: