-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 1.3.0.rc0
-
Component/s: None
-
Labels:None
-
Fully Compatible
Methods in Mongo::DB that check collection_names.include?(name) don't find a collection when the collection name is passed as a symbol. This doesn't match the behavior when the collection name passed in is used to instantiate a Mongo::Collection instance which does support symbols for collection names.
My team ran into an issue where we ran Mongo::DB#drop_dollection(:collection_name) and didn't catch that it was a no-op since it returned true. The drop_collection method is coded to return true quickly if it doesn't find the name, and it does that comparison against an array of strings.
Mongo::DB methods affected: create_collection (in strict mode), collection (in strict mode), and drop_collection.