exec access

This commit is contained in:
mr 2024-08-02 17:38:51 +02:00
parent e320efd70e
commit 0b5df45a02

View File

@ -279,10 +279,11 @@ func (m *MongoDB) Search(filters *dbs.Filters, collection_name string) (*mongo.C
} }
if len(orList) > 0 && len(andList) == 0 { if len(orList) > 0 && len(andList) == 0 {
f = bson.D{{"$or", orList}} f = bson.D{{"$or", orList}}
} else if len(orList) == 0 && len(andList) > 0 { } else {
if len(orList) > 0 {
andList = append(andList, bson.M{"$or": orList})
}
f = bson.D{{"$and", andList}} f = bson.D{{"$and", andList}}
} else if len(orList) > 0 && len(andList) > 0 {
f = bson.D{{"$and", andList}, {"$or", orList}}
} }
} }