queries (using derby) doesn't follow established naming convention of ids #20

Closed
cjblomqvist opened this Issue May 21, 2012 · 1 comment

Comments

Projects
None yet
2 participants

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)

Contributor

nateps commented Jun 4, 2013

No longer relevant in 0.5

nateps closed this Jun 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment