spec/runners/unified/crud_operations.rb in mongo-2.15.0.alpha vs spec/runners/unified/crud_operations.rb in mongo-2.15.0
- old
+ new
@@ -1,12 +1,19 @@
+# frozen_string_literal: true
+# encoding: utf-8
+
module Unified
module CrudOperations
def find(op)
collection = entities.get(:collection, op.use!('object'))
use_arguments(op) do |args|
- req = collection.find(args.use!('filter'))
+ opts = {}
+ if session = args.use('session')
+ opts[:session] = entities.get(:session, session)
+ end
+ req = collection.find(args.use!('filter'), **opts)
if batch_size = args.use('batchSize')
req = req.batch_size(batch_size)
end
if sort = args.use('sort')
req = req.sort(sort)