Module: MongoidDocumentMethods::ClassMethods
- Defined in:
- lib/mongoscript/orm/mongoid_document_methods.rb
Instance Method Summary collapse
Instance Method Details
#find_by_javascript(script_name, *args) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/mongoscript/orm/mongoid_document_methods.rb', line 5 def find_by_javascript(script_name, *args) args = args.unshift(script_name) # get a bunch of results via a Mongoid Javascript call, # then turn each hash result into a Mongoid document MongoScript.execute_readonly_routine(*args).map { |hash| rehydrate(self, hash) } end |