mercredi 8 juillet 2015

Ember-data support for NoSQL documents

I've been learning some Ember lately. I hit the problem realizing that ember-data does not support NoSQL documents. Sure, you can create a flat model but that defeats the point of a document.

I still hope that I missed something big. So, this is a simple article document example.

db.articles.findOne()
{
    "_id" : ObjectId("545a3264d293c94a08000001"),
    "subject" : "Some subject",
    "groups" : ["g1", "g2"]
    "body" : "Fat Body",
    "stats" : {
        "score" : NumberLong(0),
        "views" : NumberLong(5)
    },
    "owner" : "admin",
    "seq" : NumberLong(1),
    "touch" : {
        "who" : "admin",
        "when" : NumberLong("1434702521285")
    }
}

How do I create a model for it? How do I do projections retrieving only parts of a document?

Thanks

Aucun commentaire:

Enregistrer un commentaire