Search code examples
ruby-on-railsmongodb

When rails app create database and collection when using MongoDb?


I am new to rails.In the case of sqlite rails app make changes in db when ever we run migrations. but if we uses mongodb when it make changes in db??. thanks in advance for help...


Solution

  • Collections in mongodb are created on the fly when the first document is inserted.

    When using rails with mongoid you would create the database first with rake db:create.