Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-895

support multiple arguments to addToSet

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.0.0
    • Affects Version/s: None
    • Component/s: 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 Unassigned
            Reporter:
            gregwebs gregwebs
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: