Take the 2-minute tour ×

We are having schemaless database on MongoDB in Rails. I want to know how to use such a schemaless emberjs data design to integrate with such a design.

I am not able to find any documentation on if this can be achieved or if there is any best practice

Can any one help me with this ?

EDIT: Question is on how to use EmberJS persistent datastore for a schemaless MongoDB Rails backend.

share|improve this question

3 Answers 3

The first two links below should help. See how the first link is setting primaryKey: '_id' to recognize mongodb _id and the second link shows how to make active_model_serializer gem work with mongoid, the gem is ember-core team's recommended gem for working with rails and ember-data :



If you run into problems with embedded mongodb documents and ember-data, this should solve it:

Ember-data embedded objects stored as separate objects

Read the link below and also examine the github project:



This is not using rails but nodejs, mongodb and emberjs. The mongodb + emberjs might still be useful to you


share|improve this answer
I have seen github.com/evendis/rails-ember-mongo-bootstrap-demo My issue with schemaless DB is that in the EmberJS model link I don't have any pre-defined resourceProperties . So how can we use any thing like ember-rest, ember-data etc. –  sudhanshu Sep 6 '12 at 23:31

There is still no clear and scalable solution I see of how to apply Ember to scenario where the Rails backend database like MongoDB stores document of any depth with unknown fields.

There are some ways of normalizing but still with existing REST/REST+DS we may have to write a lot of code to serialize and de serialize.

Take a peek on the discussions:

https://github.com/emberjs/data/issues/53#issuecomment-9196555 https://github.com/emberjs/data/issues/100

If some one finds a better pick, please share with me.

share|improve this answer

Jus follow the links http://robert-reiz.com/2012/03/05/rails-mongodb-tutorial/, http://www.mongodb.org/display/DOCS/Rails+3+-+Getting+Started

share|improve this answer
Question is on how to use EmberJS persistent datastore for a schemaless MongoDB Rails backend. –  sudhanshu Aug 28 '12 at 11:49

Your Answer


