lib/parse/query.rb
def compile(encode: true, includeClassName: false)
      run_callbacks :prepare do
        q = {} #query
        q[:limit] = @limit if @limit.is_a?(Numeric) && @limit > 0
        q[:skip] = @skip if @skip > 0

        q[:include] = @includes.join(',') unless @includes.empty?
        q[:keys] = @keys.join(',')  unless @keys.empty?
        q[:order] = @order.join(',') unless @order.empty?
        unless @where.empty?
          q[:where] = Parse::Query.compile_where(@where)
          q[:where] = q[:where].to_json if encode
        end

        if @count && @count > 0
          # if count is requested
          q[:limit] = 0
          q[:count] = 1
        end
        if includeClassName
          q[:className] = @table
        end
        q
      end
    end
def compile(encode: true, includeClassName: false)
      run_callbacks :prepare do
        q = {} #query
        q[:limit] = @limit if @limit.is_a?(Numeric) && @limit > 0
        q[:skip] = @skip if @skip > 0

        q[:include] = @includes.join(',') unless @includes.empty?
        q[:keys] = @keys.join(',')  unless @keys.empty?
        q[:order] = @order.join(',') unless @order.empty?
        unless @where.empty?
          q[:where] = Parse::Query.compile_where(@where)
          q[:where] = q[:where].to_json if encode
        end

        if @count && @count > 0
          # if count is requested
          q[:limit] = 0
          q[:count] = 1
        end
        if includeClassName
          q[:className] = @table
        end
        q
      end
    end
Complies the query and runs all prepare callbacks.
 @param encode [Boolean] whether to encode the `where` clause to a JSON string.
 @param includeClassName [Boolean] whether to include the class name of the collection.
 @return [Hash] a hash representing the prepared query request.
 @see #before_prepare
 @see #after_prepare