Closed cjblomqvist closed 11 years ago
Using paths, one can do:
model.subscribe( 'document.*', function( err, scoped_model ) { assert( model.get( 'document.' + <id#1> ) === { _id: 'test', other_field: 'test' } ); // TRUE });
But using queries, this is the current behavior:
model.subscribe( model.query('document').where('_id').within( [ <id#1>, <id#2>, ... <all ids> ] ), function( err, scoped_model ) { assert( model.get( 'document.' + <id#1> ) === { _id: 'test', other_field: 'test' } ); // FALSE // But assert( model.get( 'document.' + <id#1> ) === { id: 'test', other_field: 'test' } ); // TRUE });
Notice the difference of the name of the id field. Also worth noticing is that it's still (only) possible to query on the _id field.
(PS. I'm using the racer-mongo adapter and a MongoDB in the backend - dunno if that info helps though)
No longer relevant in 0.5
Using paths, one can do:
But using queries, this is the current behavior:
Notice the difference of the name of the id field. Also worth noticing is that it's still (only) possible to query on the _id field.
(PS. I'm using the racer-mongo adapter and a MongoDB in the backend - dunno if that info helps though)