pull/455/head
wangchuxiao 3 years ago committed by Xinwei Xiong(cubxxw-openim)
parent 7ecd39acb7
commit 103c0f88ee

@ -20,7 +20,9 @@ func GetUserAllChat(uid string) {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
collection := Client.Database(config.Config.Mongo.DBDatabase).Collection("msg")
var userChatList []db.UserChat
result, err := collection.Find(context.Background(), bson.M{"uid": bson.M{"$regex": uid}})
//filter := bson.M{"uid": bson.M{"$regex": uid}}
filter := bson.M{"uid": "17726378428:0"}
result, err := collection.Find(context.Background(), filter)
if err != nil {
fmt.Println("find error", err.Error())
return

Loading…
Cancel
Save