【发布时间】:2011-12-22 10:25:53
【问题描述】:
我是 Rails 应用程序的新手。我使用 mongoid 与 mongodb 建立了联系。 我使用名为
的命令生成了 mongoid:migrationrails generate migration sample
它创造,
db\migrate\20111222081138_sample.rb 包含以下代码
class Sample < Mongoid::Migration
def self.up
sample.create(first_name: "Heinrich", last_name: "Heine")
end
def self.down
end
end
my questions are 1.why schema.rb is not present in db. 2.how to populate data into mongodb using rails 3.how to list db collections in rails 4.how to produce bson file into rails
【问题讨论】:
-
你读过关于 MongoId 或 MongoDB 的文档吗?
-
为 mongoid 迁移?我认为这里有问题。请查看 mongoid、mongodb 和 rails 的文档。正如 Simone 所指出的,最好先学习一项技术。
标签: ruby-on-rails mongodb mongoid