mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-07-07 21:03:20 +08:00
update user fisrtname and lastname
This commit is contained in:
parent
1444496c9d
commit
a305b7f862
@ -63,7 +63,15 @@ func (u *UserMgo) UpdateByMap(ctx context.Context, userID string, args map[strin
|
|||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return mongoutil.UpdateOne(ctx, u.coll, bson.M{"user_id": userID}, bson.M{"$set": args}, true)
|
filter := bson.M{"user_id": userID}
|
||||||
|
update := bson.M{"$set": args}
|
||||||
|
if err := mongoutil.UpdateOne(ctx, u.coll, filter, update, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keep user attributes in sync for consumers that read from the "attribute" collection.
|
||||||
|
attributeColl := u.coll.Database().Collection("attribute")
|
||||||
|
return mongoutil.UpdateOne(ctx, attributeColl, filter, update, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UserMgo) Find(ctx context.Context, userIDs []string) (users []*model.User, err error) {
|
func (u *UserMgo) Find(ctx context.Context, userIDs []string) (users []*model.User, err error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user