Skip to content

Instantly share code, notes, and snippets.

@sunny0425
Created August 23, 2012 03:23
Show Gist options
  • Save sunny0425/3431858 to your computer and use it in GitHub Desktop.
Save sunny0425/3431858 to your computer and use it in GitHub Desktop.
batch = [{:name => "mongodb"}, {:name => "mongoid"}]
Article.collection.insert(batch)
# my example
batch = [{ :name => '最高权限管理员', :level => DbRole::SuperAdmin }, { :name => '内容管理员', :level => DbRole::ContentAdmin }, { :name => '普通用户', :level => DbRole::NormalUser }]
DbRole.collection.insert(batch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment