1 ruby-on-rails mongodb mongoid
我是rails应用程序的新手.我使用mongoid与mongodb建立联系.我使用命令生成了mongoid:migration
rails generate migration sample
Run Code Online (Sandbox Code Playgroud)
它创建,
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
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)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
| 归档时间: |
|
| 查看次数: |
1263 次 |
| 最近记录: |