|
@@ -121,9 +121,9 @@ func RepoUpdateSetDoc(ctx *RepoSession, collectName string, idstr string, model
|
|
|
return colls.UpdateByID(ctx.Ctx, uid, update)
|
|
|
}
|
|
|
|
|
|
-func RepoUpdateDbSetDoc(ctx *RepoSession, Db string, collectName string, idstr string, model interface{}) (*mongo.UpdateResult, error) {
|
|
|
+func RepoUpdateDbSetDoc(ctx *RepoSession, db string, collectName string, idstr string, model interface{}) (*mongo.UpdateResult, error) {
|
|
|
|
|
|
- colls := ctx.Client.GetDbCollection(Db, collectName)
|
|
|
+ colls := ctx.Client.GetDbCollection(db, collectName)
|
|
|
|
|
|
update := bson.M{"$set": model}
|
|
|
|
|
@@ -145,9 +145,9 @@ func RepoUpsertSetDoc(ctx *RepoSession, collectName string, filter interface{},
|
|
|
return coll.UpdateOne(ctx.Ctx, filter, update, opts)
|
|
|
}
|
|
|
|
|
|
-func RepoUpdateSetDocProps(ctx *RepoSession, collectName string, idstr string, update interface{}) (*mongo.UpdateResult, error) {
|
|
|
+func RepoUpdateSetDbDocProps(ctx *RepoSession, db string, collectName string, idstr string, update interface{}) (*mongo.UpdateResult, error) {
|
|
|
|
|
|
- colls := ctx.Client.GetCollection(collectName)
|
|
|
+ colls := ctx.Client.GetDbCollection(db, collectName)
|
|
|
// update := bson.M{"$set": model}
|
|
|
uid, _ := primitive.ObjectIDFromHex(idstr)
|
|
|
return colls.UpdateByID(ctx.Ctx, uid, update)
|