support multiple arguments to addToSet

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

       ruby
      model.add_to_set :set, 1, 2
      TypeError Exception: can't convert Symbol into Integer
      

      Note that passing an array [1,2] will add an array to the set.

      mongoDB supports multiple arguments to addToSet.
      http://www.mongodb.org/display/DOCS/Updating#Updating-%24addToSet
      Is there a way to do this in mongoid currently? If not I would consider the current API to have a defect- at a minimum instead of a TypeError there should be an error: "multiple values not supported..."

              Assignee:
              Unassigned
              Reporter:
              gregwebs
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: