You're viewing the legacy docs. They are deprecated as of May 18, 2016.
These docs are for version 2.4.2 and below of the Javascript SDK. Go to our current docs, or see our Web migration guide.

API

EmberFire

FirebaseAdapter

Sync your Ember Data models with Firebase

Arguments

firebase - Firebase reference
The Firebase database URL to sync with the Ember Data Store. Your Firebase database name is automatically added to config/environment.js when you run ember generate firebase-adapter ref:https://.firebaseio.com/.
// app/adapters/application.js
import Firebase from 'firebase';
import FirebaseAdapter from 'emberfire/adapters/firebase';

export default FirebaseAdapter.extend({
  firebase: new Firebase('https://<YOUR-FIREBASE-APP>.firebaseio.com/')
});

findQuery

Query your data with Firebase's querying methods. With the exception of orderBy, the properties in this query object follow the same conventions as the methods available in the core Firebase JavaScript library.

Arguments

orderBy - String
The property to order your data by. If orderBy is omitted, records will be ordered by their push ID by default. See Firebase's querying documentation for more details.
limitToLast - Number
Returns the last number of ordered messages indicated by the given number.
limitToFirst - Number
Returns the first number of ordered messages indicated by the given number.
startAt - String, Number, Null
Creates a query with the specified starting point.
endAt - String, Number, Null
Creates a query with the specified ending point. The query includes children which match the specified ending point.
equalTo - String, Number, Null
Creates a query which includes children which match the specified value.

In the following example, we have a Dinosaur model and are retrieving the 10 tallest dinosaurs with a height greater than 5.

// app/routes/dinosaurs.js
export default Ember.Route.extend({
  model: function() {
    return this.store.find('dinosaur', {
      orderBy: 'height',
      limitToLast: 10,
      startAt: 5
    });
  }
});

This example queries the dinosaur data at https://dinosaur-facts.firebaseio.com/dinosaurs.

Additional Resources