ndabAP / vue-sails-example

NOT MAINTAINED Vue.js with Sails.js example project with many features

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using sails-mongo adapter

L1qu1d1c3 opened this issue · comments

Hello,

I made all the necessary changes for the back-end to work with sails-mongo but for some reason, it keeps using the localdisk file. I made changes to:

datastores.js :

adapter: 'sails-mongo',
url: 'mongodb://localhost:27017/sailsApp'

Modified the development.js file with the following changes:

models: {
    connection: 'mongodb://localhost:27017/sailsApp'
  }

But that still doesnt do it. Error is:
Error: Consistency violation: A model (`basket`) references a datastore which cannot be found (mongodb://localhost:27017/sailsApp). If this model definition has an explicit "connection" property, check that it is spelled correctly. If not, check your default `connection` (usually located in "config/models.js")

Do you have any official way of setting it up with mongodb? Because the native way of doing it with sails isn't working.

Thank you!

This is an example project. Your issue is related to a package I don't maintain. Please ask the maintainers:

https://github.com/balderdashy/sails-mongo

Ok... Thanks for nothing I guess..
I eventually figured out how to integrate your example with mongoDB... Aside from the modifications I mentioned above, modify the environment.js file to include the following:

  models: {
    connection: 'mongoRM',
    migrate: 'safe'
  },
  connections: {
    mongoRM: {
      adapter: 'sails-mongo',
      url: 'mongodb://localhost:27017/sailsApp'
    }
  },