1

I'm using npm to install:

  • sailsjs: npm install -g git://github.com/balderdashy/sails.git (v0.10 - master)

  • sails-mongo adapter: npm install git://github.com/balderdashy/sails-mongo.git (also v0.10 - master)

  • mongoDB version : 2.6.1

When executing "sails lift", I'm expecting it to

a) lift my server b) create my database on mongodb server and the collections defined in my models.

config :

connections.js

mongo : {
    adapter: 'sails-mongo',
    host: '127.0.0.1',
    port: 27017,
    user: '',
    password : '',
    database : 'mydb'
}

models.js

connection : 'mongo'

I have not defined any additional connection information in local.js

I lift my server, check mongodb via the terminal and do not see "mydb" created.

Any idea's?

extra info

I did read that if you have any configuration issues when defining an adapter that it will default to the localDiskDb.

medimatrix
  • 137
  • 11
Francois
  • 63
  • 7
  • 2
    MongoDB does not create a database or collection until the first document is inserted. This is basically how it works and is by design. When you insert some data the database and collection will be created. – Neil Lunn May 25 '14 at 03:23
  • Thanks for the response Neil. Based on my previous experience using Sailsjs - On "sails lift" the database was created aswell as the collections. – Francois May 25 '14 at 09:55
  • It shouldn't unless there is actually some content to load. Try a raw project and see if you can re-produce. But I think you are mistaking default intended behavior for an error or bug. – Neil Lunn May 25 '14 at 10:00
  • Thanks Neil. I am now using the Mysql adapter. I just could have sworn that when I first started on a previous sails and mongo version (0.9.x) the tables were generating with no collections... I will revisit at another stage. Mysql is actually better suited to my application anyway. – Francois May 26 '14 at 17:51

0 Answers0