You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/02/18 07:07:51 UTC

[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #862: unified account ut and fix account bugs.

tianxiaoliang commented on a change in pull request #862:
URL: https://github.com/apache/servicecomb-service-center/pull/862#discussion_r578176819



##########
File path: datasource/mongo/account.go
##########
@@ -146,11 +148,12 @@ func (ds *DataSource) UpdateAccount(ctx context.Context, key string, account *rb
 			ColumnStatus:              account.Status,
 		},
 	}
-	result, err := client.GetMongoClient().Update(ctx, CollectionAccount, filter, update)
+	result, err := client.GetMongoClient().Update(ctx, CollectionAccount, filter, update, options.Update().SetUpsert(true))
 	if err != nil {
 		return err
 	}
-	if result.ModifiedCount == 0 {
+	//fmt.Println("")

Review comment:
       不要注释

##########
File path: datasource/mongo/util.go
##########
@@ -56,6 +56,10 @@ func BuildIndexDoc(keys ...string) mongo.IndexModel {
 	return index
 }
 
+func BuildPrefixFilter(key string) string {

Review comment:
       StartWith准确些,更好理解




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org