spec/runners/unified/crud_operations.rb in mongo-2.18.0.beta1 vs spec/runners/unified/crud_operations.rb in mongo-2.18.0

- old
+ new

@@ -10,10 +10,18 @@ use_arguments(op) do |args| opts = { let: args.use('let'), comment: args.use('comment'), allow_disk_use: args.use('allowDiskUse'), + show_disk_loc: args.use('showRecordId'), + return_key: args.use('returnKey'), + projection: args.use('projection'), + skip: args.use('skip'), + hint: args.use('hint'), + max_value: args.use('max'), + max_time_ms: args.use('maxTimeMS'), + min_value: args.use('min'), } if session = args.use('session') opts[:session] = entities.get(:session, session) end req = collection.find(args.use!('filter'), **opts) @@ -24,10 +32,13 @@ req = req.sort(sort) end if limit = args.use('limit') req = req.limit(limit) end + if projection = args.use('projection') + req = req.projection(projection) + end result = req.to_a end end def count_documents(op) @@ -63,10 +74,13 @@ use_arguments(op) do |args| opts = {} if session = args.use('session') opts[:session] = entities.get(:session, session) end + if comment = args.use('comment') + opts[:comment] = comment + end req = collection.find(args.use!('filter'), **opts).distinct(args.use!('fieldName'), **opts) result = req.to_a end end @@ -157,10 +171,11 @@ use_arguments(op) do |args| opts = { let: args.use('let'), comment: args.use('comment'), hint: args.use('hint'), + upsert: args.use('upsert'), } if session = args.use('session') opts[:session] = entities.get(:session, session) end collection.update_one(args.use!('filter'), args.use!('update'), **opts) @@ -225,11 +240,11 @@ use_arguments(op) do |args| requests = args.use!('requests').map do |req| convert_bulk_write_spec(req) end opts = {} - if ordered = args.use('ordered') - opts[:ordered] = true + if args.key?('ordered') + opts[:ordered] = args.use!('ordered') end if comment = args.use('comment') opts[:comment] = comment end if let = args.use('let')