class Mongo::Operation::Aggregate
A MongoDB aggregate operation.
@note An aggregate operation can behave like a read and return a
result set, or can behave like a write operation and output results to a user-specified collection.
@api private
@since 2.0.0
Aggregate
result wrapper.
@since 2.0.0
Public Instance Methods
execute(server)
click to toggle source
Execute the operation.
@example
operation.execute(server)
@param [ Mongo::Server
] server The server to send the operation to.
@return [ Mongo::Operation::Aggregate::Result
] The operation result.
@since 2.0.0
# File lib/mongo/operation/aggregate.rb, line 44 def execute(server) if server.features.op_msg_enabled? OpMsg.new(spec).execute(server) else Command.new(spec).execute(server) end end