-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: 2.18.1, 2.17.3
-
Component/s: None
-
None
-
None
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
Collection create method accepts a hash of options, that can contain among others the following keys: :capped, :max, :size, :collation: pipeline. However, these options are ignored and not used when creating a collection.
The following code works properly, passing an invalid option value causes an error:
%i(capped max size collation pipeline).each do |opt| client['coll'].drop begin client['coll', opt => 'x'].create puts "Option :#{opt} was ignored" rescue Mongo::Error::OperationFailure => e puts "Option :#{opt} was passed" end end
The following code is broken, invalid options are ignored:
%i(capped max size collation pipeline).each do |opt| client['coll'].drop begin client['coll'].create(opt => 'x') puts "Option :#{opt} was ignored" rescue Mongo::Error::OperationFailure => e puts "Option :#{opt} was passed" end end