lib/mongo/operation/collections_info.rb in mongo-2.14.1 vs lib/mongo/operation/collections_info.rb in mongo-2.15.0.alpha

- old
+ new

@@ -23,9 +23,26 @@ # @api private # # @since 2.0.0 class CollectionsInfo include Specifiable - include CollectionsInfoOrListCollections + include PolymorphicOperation + include PolymorphicLookup + + 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) + end end end end