Reputation: 11615
Our current stack uses Angular.js at the front-end, and Web APIs written in C# at the back-end.
We are investigating the possibility of using Node.js at the back-end for some future developments. One question that comes up is object-relational mapping. We currently Entity Framework 6 with .NET stack, and it works really well. What would be the equivalent in the Node.js world? How robust is it?
Upvotes: 0
Views: 218
Reputation: 168
For SQL databases, there is:
All three have different features and way to deal with your models. It tends to be a matter of taste (taking in consideration the maturity of the project)
Upvotes: 1
Reputation: 1276
Mongo.db with Mongoose is very close to ORM. You can define Schemas and handle them very easily. You will just end up with javascript objects when you query, and you will be able to simply call .save on them.
var PersonModel = mongoose.model('Person', new Schema({
firstName: {type: String},
lastName: {type: String}
}));
var bob= new PersonModel({
firstName : "Bob",
lastName : "Smith",
});
bob.save(callback);
There is http://docs.sequelizejs.com/en/latest/ if you need to use SQL databases, however, I have not had any experience with it.
Upvotes: 1