Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-260

Mongo::DB should support symbols for collection names in all use cases

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3.1
    • 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.

            Assignee:
            kbanker Kyle Banker
            Reporter:
            cgriego Chris Griego
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: