当前位置: 动力学知识库 > 问答 > 编程问答 >

node.js - error:a hook ('orm') failed to load when lifting sails app using mongo DB

问题描述:

I get this error: a hook ('orm') failed to load when trying to lift a sails app using mongoDB. This my connections.js file:

module.exports.connections = {

mongodb: {

adapter : 'sails-mongo',

host : 'localhost',

port : 27017,

database : 'mydb1'

}

};

And this is my models.js file:

module.exports.models = {

connection: 'mongodb'

};

And this is my local.js file:

module.exports = {

connections: {

mongodb: {

host : 'localhost',

port : 27017,

database : 'mydb1'

}

}

}

Sails v 0.10.1

Any idea why this could be happening?

Thanks

网友答案:

All you need to do is start your mongodb.

Navigate to : path_to_your_mongodb_installation_folder\MongoDB\bin\mongod.exe example : C:\Program Files\MongoDB 2.6 Standard\bin

Let us know if this helps!

网友答案:

Add

models: {
    connect: 'your_mongod_db_adapter_name'
}

in both env/development and env/production fixed the problem for me

分享给朋友:
您可能感兴趣的文章:
随机阅读: