lib/mongo/operation/distinct.rb in mongo-2.6.4 vs lib/mongo/operation/distinct.rb in mongo-2.7.0.rc0
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (C) 2017-2018 MongoDB, Inc.
+# Copyright (C) 2017-2019 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@@ -23,26 +23,9 @@
# @api private
#
# @since 2.5.0
class Distinct
include Specifiable
-
- # Execute the operation.
- #
- # @example
- # operation.execute(server)
- #
- # @param [ Mongo::Server ] server The server to send the operation to.
- #
- # @return [ Mongo::Operation::Result ] The operation result.
- #
- # @since 2.5.0
- def execute(server)
- if server.features.op_msg_enabled?
- OpMsg.new(spec).execute(server)
- else
- Command.new(spec).execute(server)
- end
- end
+ include OpMsgOrCommand
end
end
end