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
It appears that (at least for Memory store) filtering produces sub-collections that expose (excluded) parent items. Memory.getSync explicitly retrieves items from storage.fullData, so I wonder if this is by design for some reason:
getSync: function (id) {
return this.storage.fullData[this.storage.index[id]];
},
var all = new Memory({data:[{id:1, c: 'all'}, {id:2, c: 'subset'}]})
var subset = all.filter({c: 'subset'})
subset.fetchSync() // [{id:2, c: 'subset'}]
subset.data // [{id:2, c: 'subset'}]
subset.get(1) // {id:1, c: 'all'}, I would expect null/undefined here
Hypothetically Memory could consult data instead of this.storage.fullData however it appears that lookup is based on an position index maintained against the fullData, so doing so would require keeping a per-sub-collection index for lookups (or changing how indexing/lookup is implemented).
The text was updated successfully, but these errors were encountered:
It appears that (at least for
Memory
store) filtering produces sub-collections that expose (excluded) parent items.Memory.getSync
explicitly retrieves items fromstorage.fullData
, so I wonder if this is by design for some reason:Hypothetically Memory could consult
data
instead ofthis.storage.fullData
however it appears that lookup is based on an position index maintained against the fullData, so doing so would require keeping a per-sub-collection index for lookups (or changing how indexing/lookup is implemented).The text was updated successfully, but these errors were encountered: