lib/mongo/operation/collections_info.rb in mongo-2.18.1 vs lib/mongo/operation/collections_info.rb in mongo-2.18.2
- old
+ new
@@ -13,11 +13,10 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'mongo/operation/collections_info/command'
require 'mongo/operation/collections_info/result'
module Mongo
module Operation
@@ -26,26 +25,15 @@
# @api private
#
# @since 2.0.0
class CollectionsInfo
include Specifiable
- include PolymorphicOperation
- include PolymorphicLookup
+ include OpMsgExecutable
private
- def final_operation(connection)
- op_class = if connection.features.list_collections_enabled?
- if connection.features.op_msg_enabled?
- ListCollections::OpMsg
- else
- ListCollections::Command
- end
- else
- CollectionsInfo::Command
- end
-
- op_class.new(spec)
+ def final_operation
+ ListCollections::OpMsg.new(spec)
end
end
end
end