First, add MongoMapper to your Gemfile
, and run bundle install
:
If you’re not using Bundler.require
in the top of your Sinatra application then you’ll need to require the MongoMapper library:
You’ll also need to set up your MongoDB connection in your configure
method call. If you have a MongoDB URI for the database connection (i.e. on Heroku):
You can now define your models and start using MongoMapper in Sinatra!