javascript - How to organize models in a node.js website? -
I just node I started experimenting with creating a website using JS, and during the event of my model I have to face a problem. The Mongoos are being used in all real world examples found on the Internet This library allows you to define your model in a steady manner. You can write it: // model / foo.js module.exports = ('Mongoose') is required. Model ('foo', ...); // app.js mongoose.connect (...); // some_controller_1.js var Foo = Requirement ('./Model / Foo'); Foo.find (...); // some_controller_2.js var Foo = Requirement ('./Model / Foo'); Foo.find (...); But since I do not want to use mongodbi, I need another ORM and I have not received any other ORM that I got this permission. You first need to create an example, and then only you can register your model. In addition, they do not allow access to the list of registered models. So I tried to do this: // model / user.js var registration = []; Module Exports = function (sequelize) {var ...