Skip to content

Instantly share code, notes, and snippets.

@beanieboi
Created June 26, 2012 11:19
Show Gist options
  • Save beanieboi/2995210 to your computer and use it in GitHub Desktop.
Save beanieboi/2995210 to your computer and use it in GitHub Desktop.
read bson
file = File.new(File.join(Rails.root, 'extras', 'bson', 'foobar.bson')
while not file.eof? do
entry = BSON.read_bson_document(file)
entry.delete("_id")
Entry.create(entry)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment