jeudi 26 novembre 2015

How to query with equalTo in emberfire?

I'm trying to make a trully simple query with Emberfire, but it's not working. No console errors, it just doesn't do a thing.
My versions are Ember 2.2.0, Ember-data 2.2.0 and EmberFire 1.6.1
My data is something like the folowing:

{
  'data':[{
   'element' : 0 
  },{
   'element' : 1 
  },{
   'element' : 1 
  },{
   'element' : 0 
  },{
   'element' : 2 
  }]
}

And my query in Ember would be something like this:

export default Ember.Route.extend({
  model(){
    return this.store.query('data', { orderBy: 'element', equalTo: 1 } );
  }
});

The results, passing trough an each loop, are looking like this

0 0 1 1 2

Only works the orderBy part, not the equalsTo. Any suggestions?




Aucun commentaire:

Enregistrer un commentaire