Skip to content

Instantly share code, notes, and snippets.

@bittersweet
Created September 15, 2011 12:32
Show Gist options
  • Save bittersweet/1219121 to your computer and use it in GitHub Desktop.
Save bittersweet/1219121 to your computer and use it in GitHub Desktop.
Creating a capped collection via the mongo ruby driver
require 'mongo'
m = Mongo::Connection.new
db = m['metric_io_development']
db.create_collection('incoming', {:capped => true, :max => 10})
# https://github.com/bcg/em-mongo/blob/master/lib/em-mongo/database.rb#L117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment