Skip to content

Instantly share code, notes, and snippets.

@akaDPR
Created August 4, 2018 10:55
Show Gist options
  • Save akaDPR/b5197fa0d06adb81e58384bd7c2e85fa to your computer and use it in GitHub Desktop.
Save akaDPR/b5197fa0d06adb81e58384bd7c2e85fa to your computer and use it in GitHub Desktop.
Rails - MongoDB - Mongoid
Rails with mongoDB
rails new your_app_name --skip-active-record
Install 'mongoid' ORM
rails g model
rails g controller
If your field in MongoDB collection is Dynamic - Use this * include Mongoid::Attributes::Dynamic *
@akaDPR
Copy link
Author

akaDPR commented Aug 17, 2018

development:
clients:
default:
uri: <%= ENV['MONGODB_URI'] || 'mongodb://localhost:27017/local' %>
options:
connect_timeout: 15

production:
clients:
default:
uri: <%= ENV['MONGODB_URI'] %>
options:
connect_timeout: 15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment