Closed fredtma closed 7 years ago
For MongoDB, we've used: https://pub.dartlang.org/packages/mongo_dart.
There isn't a plan to support document databases with the ORM. I recognize that it's common to use a MongoDB "ODM" in NodeJS, but to be honest, I never understood the point. What are some of the compelling reasons I'm missing for having ORM-like behavior on a document database?
On a related note for future visitors, Aqueduct 3.0 includes support for JSONB columns. Quote from here:
The Aqueduct ORM now supports PostgreSQL JSONB columns. JSONB columns store JSON data, similar to key-value databases like MongoDB. An example usage of a JSONB column looks like this:
final query = Query(context)
..values.timestamp = DateTime.now()
..values.contents = Document({
"type": "push",
"user": "bob",
"tags": ["v1"]
});
final event = await query.insert();
Documentation on using JSONB columns is available here.
@joeconwaystk
What are some of the compelling reasons I'm missing for having ORM-like behavior on a document database?
Mostly consistency in translation between a database document and a language model.
e.g.
mongo | dart |
---|---|
ObjectId | String |
ISODate | DateTime |
I believe mongo_dart provides this to a degree.
If using annotations in dart to describe validation constraints on the dart model then it provides a consistent place for those to live on the consistently hydrated dart model.
A query builder can give some advantage when exposing some kind of dynamic filter system to a user or api. I would advise against using a query builder for any static application queries.
Totally new to Dart and Aquaduct (nodeJs dev). Reading the documentation I do not see support for document orientated database (mongo). Is there plan to support this?