Changed parameters for find in collection
This commit is contained in:
parent
2d90d45c74
commit
ee1ae4a3ca
@ -26,9 +26,9 @@ module XGen
|
|||||||
@name = name
|
@name = name
|
||||||
end
|
end
|
||||||
|
|
||||||
def find(selector={}, fields=nil, options={})
|
def find(selector={}, options={})
|
||||||
fields = nil if fields && fields.empty?
|
options = { :fields => nil, :offset => 0, :limit => 0, :sort => nil}.update(options)
|
||||||
@db.query(@name, Query.new(selector, fields, options[:offset] || 0, options[:limit] || 0, options[:sort]))
|
@db.query(@name, Query.new(selector, options[:fields], options[:offset], options[:limit], options[:sort]))
|
||||||
end
|
end
|
||||||
|
|
||||||
def insert(*objects)
|
def insert(*objects)
|
||||||
|
Loading…
Reference in New Issue
Block a user