0

I try to use just ruby without rails. But like to have mongoid gem in order to use several methods.

By include installed mogoid gem together with mogod and others required setup for mongoid, my ruby app still not able to use mogoid method like: find_or_create_by.

  1. Can I use mongoid without create all with rails
  2. How to setup ?

1 Answer 1

1

See the Sinatra tutorial in Mongoid documentation for how to get started with Mongoid without Rails.

Source code is also available.

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

3 Comments

I followed the link ruby-driver. It brought me to install rails. As quote "Because MongoDB is so easy to use, the basic Ruby driver can be the best solution for many applications. But if you need validations, associations, and other high-level data modeling functions, then you may need Object Document Mapper." Then it link to install rails (docs.mongodb.com/ruby-driver/master/#object-mappers)
find_or_create_by is actually a Mongoid method, updated the answer.
Great, this exactly I looking for. Thanks

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.