Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在从 csv 文件导入的 mongodb 中有一个集合,我想将其加载到我的 ruby-on-rails3.2.13 应用程序中以在主页中列出集合文档。 我使用 mongoid 作为对象文档映射器。 谁能告诉我这个问题的过程?
如果我理解你的问题,它应该是简单明了的。
假设你有一个使用 mongoid 的模型
class Model include Mongoid::Document #define fields here end
然后在控制器中
@records = Model.all
那么你应该得到一个记录数组