Merge pull request #1737 from luhaoling/realea3.5

fix: fix the mongo search error
pull/1741/head
Xinwei Xiong 10 months ago committed by GitHub
commit 2ba45691c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -82,7 +82,7 @@ func (u *UserMgo) PageFindUser(ctx context.Context, level int64, pagination pagi
} }
func (u *UserMgo) GetAllUserID(ctx context.Context, pagination pagination.Pagination) (int64, []string, error) { func (u *UserMgo) GetAllUserID(ctx context.Context, pagination pagination.Pagination) (int64, []string, error) {
return mgoutil.FindPage[string](ctx, u.coll, bson.M{}, pagination, options.Find().SetProjection(bson.M{"user_id": 1})) return mgoutil.FindPage[string](ctx, u.coll, bson.M{}, pagination, options.Find().SetProjection(bson.M{"_id": 0, "user_id": 1}))
} }
func (u *UserMgo) Exist(ctx context.Context, userID string) (exist bool, err error) { func (u *UserMgo) Exist(ctx context.Context, userID string) (exist bool, err error) {
@ -90,7 +90,7 @@ func (u *UserMgo) Exist(ctx context.Context, userID string) (exist bool, err err
} }
func (u *UserMgo) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error) { func (u *UserMgo) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error) {
return mgoutil.FindOne[int](ctx, u.coll, bson.M{"user_id": userID}, options.FindOne().SetProjection(bson.M{"global_recv_msg_opt": 1})) return mgoutil.FindOne[int](ctx, u.coll, bson.M{"user_id": userID}, options.FindOne().SetProjection(bson.M{"_id": 0, "global_recv_msg_opt": 1}))
} }
func (u *UserMgo) CountTotal(ctx context.Context, before *time.Time) (count int64, err error) { func (u *UserMgo) CountTotal(ctx context.Context, before *time.Time) (count int64, err error) {

Loading…
Cancel
Save