CLONE - BSON encoding, passing single string to $addToSet field

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.4.4
    • Component/s: BSON
    • None
    • Environment:
      Linux
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      update := bson.D {| | | |                                 \{"$set", f}

      ,

       
                                       {"$addToSet", bson.E{"outsideIp", "string"}},
       
      }
       
       
       
      updateResult, err := collection.UpdateOne(context.TODO(), filter, update)

       

      This fails.

       

      There is another bug posted here which was closed by a person that provides code to use a string, then when an error saying you need an array shows up he says you need to use an array.

       

      https://jira.mongodb.org/browse/GODRIVER-1818

       

      That's not how programming languages work.

       

            Assignee:
            Unassigned
            Reporter:
            Andrew Hodel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: