add ne after testing

This commit is contained in:
Pavel 2024-04-24 15:35:55 +03:00
parent 953a7c569e
commit ef5fc30f0a

@ -431,16 +431,16 @@ func (receiver *AccountRepository) QuizLogoStat(ctx context.Context, req QuizLog
{"$match", bson.D{ {"$match", bson.D{
{"createdAt", bson.D{{"$gte", time.Unix(int64(*req.From), 0)}}}, {"createdAt", bson.D{{"$gte", time.Unix(int64(*req.From), 0)}}},
{"createdAt", bson.D{{"$lte", time.Unix(int64(*req.To), 0)}}}, {"createdAt", bson.D{{"$lte", time.Unix(int64(*req.To), 0)}}},
{"from", bson.D{{"$exists", true}}}, {"from", bson.D{{"$exists", true}, {"$ne", ""}}},
{"partner", bson.D{{"$exists", true}}}, {"partner", bson.D{{"$exists", true}, {"$ne", ""}}},
}}, }},
} }
pipeline = append(pipeline, match) pipeline = append(pipeline, match)
} else { } else {
match := bson.D{ match := bson.D{
{"$match", bson.D{ {"$match", bson.D{
{"from", bson.D{{"$exists", true}}}, {"from", bson.D{{"$exists", true}, {"$ne", ""}}},
{"partner", bson.D{{"$exists", true}}}, {"partner", bson.D{{"$exists", true}, {"$ne", ""}}},
}}, }},
} }
pipeline = append(pipeline, match) pipeline = append(pipeline, match)