Sha256: fee9f0350a8a4c9dbb536ca8426426f71d4e66ce83a1df8f9285eff8bfafeadd

Contents?: true

Size: 530 Bytes

Versions: 17

Compression:

Stored size: 530 Bytes

Contents

require './helper'

class FilterEx
  include MongoMapper::Document
  include MongoMapperExt::Filter

  key :title, String
  key :body, String

  filterable_keys :title, :body
end

FilterEx.delete_all
o1 = FilterEx.create(:title => "A Great Title", :body => "A great Body")
o2 = FilterEx.create(:title => "A Good Title", :body => "A good Body")


puts "filter: #{FilterEx.filter("title").size}"
puts "filter: #{FilterEx.filter("title", :limit => 1).inspect}"
puts "filter: #{FilterEx.filter("great").inspect}"


FilterEx.delete_all

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mongomapper_ext-0.5.2 examples/filter.rb
mongomapper_ext-0.5.1 examples/filter.rb
mongomapper_ext-0.5.0 examples/filter.rb
mongomapper_ext-0.4.0 examples/filter.rb
mongomapper_ext-0.3.0 examples/filter.rb
mongomapper_ext-0.2.4 examples/filter.rb
mongomapper_ext-0.2.3 examples/filter.rb
mongomapper_ext-0.2.2 examples/filter.rb
mongomapper_ext-0.2.1 examples/filter.rb
mongomapper_ext-0.2.0 examples/filter.rb
mongomapper_ext-0.1.5 examples/filter.rb
mongomapper_ext-0.1.4 examples/filter.rb
mongomapper_ext-0.1.3 examples/filter.rb
mongomapper_ext-0.1.2 examples/filter.rb
mongomapper_ext-0.1.1 examples/filter.rb
mongomapper_ext-0.1.0 examples/filter.rb
mongomapper_ext-0.0.4 examples/filter.rb