Skip to content

Instantly share code, notes, and snippets.

@rbxbx
Created May 1, 2010 03:20
Show Gist options
  • Save rbxbx/386017 to your computer and use it in GitHub Desktop.
Save rbxbx/386017 to your computer and use it in GitHub Desktop.
foos = Foo.where(:name.in => ['bar', 'baz']
#<Mongoid::Criteria:0x1035c0928 @documents=[], @klass=Foo, @selector={:name=>{"$in"=>["bar", "baz"]}}, @options={}>
foos
#[foo1, foo2, foo3, foo4]
foos.slice!(0,3)
#[foo1, foo2, foo3]
foos
#[foo1, foo2, foo3, foo4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment