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

support multiple arguments to addToSet

    XMLWordPrintable

    Details

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

      Description

       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..."

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: