Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1820

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

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

      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 Unassigned
            Reporter:
            andrewhodel@gmail.com Andrew Hodel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: