0

I am new to work with the ruby on rails with the mongodb, but i can setup my application structure properly.can someone help me to start with it. any example or sample is appreciable.

1 Answer 1

1

First you have to add gem 'mongoid', '~> 5.0.0.beta', github: 'mongoid/mongoid' in your gem file.

After that add your_app/config/mongoid.yml file

development:
 clients:
   default:
     database: database_name
     hosts:
       - localhost:27017

Then add any Model, you can add number of fields

class Model
 include Mongoid::Document

 field :name, type: String
end

Then you can test using console.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.