-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.7.5, 1.8.1, 1.8.2, 1.8.3
-
Component/s: None
-
None
Summary
when using the updateone function it results in
response field ‘n’ is type int32, but received BSON type 64-bit integer
This error does not appear before version 1.7.5 of the driver
Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).
Any version from 1.7.5 onwards
How to Reproduce
running any simple example of updateone leads to the issue
the following code is taken from the mongo DB example in the documentation
opts := options.Update().SetUpsert(true) opts := options.Update().SetUpsert(true) filter := bson.D{{"_id", id}} update := bson.D{{"$set", bson.D{{"email", "newemail@example.com"}}}}
result, err := coll.UpdateOne(context.TODO(), filter, update, opts) if err != nil { log.Fatal(err) }