Closed cjblomqvist closed 11 years ago
With new query system, most likely because ids are named ids as well as _ids, whenever you do:
id
_id
store.query.expose('test', 'fromArrayOfIds', function( ids ) { return this.byId( ids ); // return this.where('_id').within( ids ); -- Will work exactly as above // return this.where('id').within( ids ); -- Won't work });
...
model.subscribe( model.query('test').fromArrayOfIds( my_array_of_ids ), function( err, scoped_tests ) {
console.log( model.get('test') ); // Returns array of test objects - ie. will return expected result console.log( scoped_tests.get() ); // Returns undefined - ie. won't return expected result
});
Probably related to the confusion mentioned in Issue #20
No longer relevant in 0.5
With new query system, most likely because
id
s are namedid
s as well as_id
s, whenever you do:store.query.expose('test', 'fromArrayOfIds', function( ids ) { return this.byId( ids ); // return this.where('_id').within( ids ); -- Will work exactly as above // return this.where('id').within( ids ); -- Won't work });
...
model.subscribe( model.query('test').fromArrayOfIds( my_array_of_ids ), function( err, scoped_tests ) {
console.log( model.get('test') ); // Returns array of test objects - ie. will return expected result console.log( scoped_tests.get() ); // Returns undefined - ie. won't return expected result
});
Probably related to the confusion mentioned in Issue #20