how can i connect to a mongodb from Ruby code?

前端 未结 3 2119
说谎
说谎 2021-02-08 21:41

how can i connect to a mongodb from Ruby code ?

3条回答
  •  再見小時候
    2021-02-08 22:16

    Kir's answer is appropriate if you are working only with Ruby. But if you are developing a Rails app, you likely will want to connect to MongoDB with an ORM such as:

    • Mongoid
    • MongoMapper

    Using an ORM will give you the functionality Rails developers are familiar with in ActiveRecord. See a list of MongoDB Clients on http://ruby-toolbox.com/.

提交回复
热议问题