Class: Deli::Adapters::Mongoid::Query

Inherits:
Query
  • Object
show all
Defined in:
lib/deli/adapters/mongoid.rb

Overview

Outputs a query hash for Mongoid.

Examples:

Declare the queries you want to make in your controller.


queries :order => "created_at desc" do
  match :full_name
  match :created, :field => :created_at
  match :status, :type => :array
  match :product, :type => :string, :field => "products.title"
  match :favorites, :type => :string, :scope => :favorite_products # does the joins / default conditions work
end

Query for “title=HelloWorld”+


{:full_name => {"$in" => "John"}}

Instance Attribute Summary

Attributes inherited from Query

#controller

Instance Method Summary collapse

Methods inherited from Query

#append_join, build_query, #conditions, #conditions?, #default_sort, #find, #initialize, #joins, #matching, #parse, parse_query, #parse_query, parse_string, #parse_string, #to_conditions, unescape

Constructor Details

This class inherits a constructor from Deli::Query

Instance Method Details

#render(params) ⇒ Object



51
52
53
# File 'lib/deli/adapters/mongoid.rb', line 51

def render(params)
  params = super
end