Assuming you are querying for user
type and query
from above is a POJO your code may look like so:
var usersPromise = store.find('user', {foo:'bar', bla: 'baz'});
The response from your server would look something like this (note: users
is plural), this is why you're receiving the error (ember.js Error: Assertion Failed: The response from a findAll must be an Array, not undefined).
{
users: [
{
id: 1,
name: 'Santa Clause'
}
]
}
Since you are querying by POJO Ember assumes there are 0+ results. After the promise has resolved you can return the first object from that, since the collection will only have one.
usersPromise.then(function(users){
return users.get('firstObject');
});
so in your case you would probably do something like this
this.store.find('user', {foo:'bar', bla: 'baz'}).then(function(users){
return users.get('firstObject');
});