Reputation: 10736
I've installed sails-mongo through npm and have a basic sails.js application running but it's not recognizing my host.
MongoDB is up and running on the default port 27017 but after I generate a model I get this error when trying to run the application:
Here is my adapter.js, I'm running node v0.10.0 and sails v0.8.895
// Configure installed adapters
// If you define an attribute in your model definition,
// it will override anything from this global config.
module.exports.adapters = {
// If you leave the adapter config unspecified
// in a model definition, 'default' will be used.
'default': 'mongo',
// In-memory adapter for DEVELOPMENT ONLY
// (data is NOT preserved when the server shuts down)
memory: {
module: 'sails-dirty',
inMemory: true
},
// Persistent adapter for DEVELOPMENT ONLY
// (data IS preserved when the server shuts down)
// PLEASE NOTE: disk adapter not compatible with node v0.10.0 currently
// because of limitations in node-dirty
// See https://github.com/felixge/node-dirty/issues/34
// disk: {
// module: 'sails-dirty',
// filePath: './.tmp/dirty.db',
// inMemory: false
// },
mongo: {
module : 'sails-mongo',
url : 'mongodb://Chris:DBPASSWORD@localhost:27017/localHostTestDB'
}
};
I've already added the user to the localHostTestDB with role of admin.
Any help would be appreciate. Thanks!
Upvotes: 1
Views: 2205
Reputation: 1
Install from NPM. Add the mongo config to the config/adapters.js file. visit http://sailsjs.org
Upvotes: 0
Reputation: 10736
Ended up having to update sails.js to version 0.9.3 and using the sails-mongo adapter as such:
module.exports.adapters = {
// If you leave the adapter config unspecified
// in a model definition, 'default' will be used.
'default': 'mongo',
mongo: {
module : 'sails-mongo',
host : 'localhost',
user : 'Chris',
password : 'PASSWORD',
database : 'localHostTestDB'
},
// In-memory adapter for DEVELOPMENT ONLY
memory: {
module: 'sails-memory'
},
// Persistent adapter for DEVELOPMENT ONLY
// (data IS preserved when the server shuts down)
disk: {
module: 'sails-disk'
},
// // MySQL is the world's most popular relational database.
// // Learn more: http://en.wikipedia.org/wiki/MySQL
// mysql: {
// module: 'sails-mysql',
// host: 'YOUR_MYSQL_SERVER_HOSTNAME_OR_IP_ADDRESS',
// user: 'YOUR_MYSQL_USER',
// password: 'YOUR_MYSQL_PASSWORD',
// database: 'YOUR_MYSQL_DB'
// }
};
Upvotes: 1