How to query MongoDB directly from Ruby instead of using Mongoid?

前端 未结 7 480
刺人心
刺人心 2020-12-24 06:33

I am writing a migration for a Rails application that uses MongoDB and Mongoid. My migration currently uses my models that use Mongoid to query and update records, but the p

7条回答
  •  滥情空心
    2020-12-24 06:57

    The short answer is Moped. This is the lower-level API that Mongoid is built upon and will be available if you already use Mongoid. The Moped API is a thin wrapper around the raw MongoDB operations. The documentation here: http://mongoid.org/en/moped/docs/driver.html should be useful.

提交回复
热议问题