Skip to content

Commit

Permalink
update query
Browse files Browse the repository at this point in the history
  • Loading branch information
rwynn committed Nov 24, 2019
1 parent fc3762d commit 17d641e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mongofluxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,15 @@ func saveTokens(client *mongo.Client, tokens bson.M, config *configOptions) erro
"resumeName": config.ResumeName,
"streamID": streamID,
}
replacement := bson.M{
update := bson.M{"$set": bson.M{
"resumeName": config.ResumeName,
"streamID": streamID,
"token": token,
}
model := mongo.NewReplaceOneModel()
}}
model := mongo.NewUpdateManyModel()
model.SetUpsert(true)
model.SetFilter(filter)
model.SetReplacement(replacement)
model.SetUpdate(update)
models = append(models, model)
}
_, err = col.BulkWrite(context.Background(), models, bwo)
Expand Down

0 comments on commit 17d641e

Please sign in to comment.