mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 03:58:55 +08:00
superGroup
This commit is contained in:
parent
3b81108738
commit
edb5cb4ee5
@ -981,7 +981,11 @@ func (d *DataBases) CreateSuperGroup(groupID string, initMemberIDList []string,
|
||||
UserID: v,
|
||||
})
|
||||
}
|
||||
_, err = c.UpdateOne(sCtx, users, bson.M{"$addToSet": bson.M{"group_id_list": groupID}})
|
||||
upsert := true
|
||||
opts := &options.UpdateOptions{
|
||||
Upsert: &upsert,
|
||||
}
|
||||
_, err = c.UpdateMany(sCtx, bson.M{"user_id": bson.M{"$in": initMemberIDList}}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts)
|
||||
if err != nil {
|
||||
session.AbortTransaction(ctx)
|
||||
return utils.Wrap(err, "transaction failed")
|
||||
|
Loading…
x
Reference in New Issue
Block a user