search is debug nested object included

This commit is contained in:
mr
2024-07-30 09:27:52 +02:00
parent 6ac855394b
commit 250fefd0d8
8 changed files with 9 additions and 14 deletions

View File

@@ -253,17 +253,11 @@ func (m *MongoDB) Search(search string, filter []string, collection_name string)
if cursor, err := targetDBCollection.Find(
MngoCtx,
bson.M{"$or": []bson.M{
{"abstractresource.abstractobject.name": bson.M{"$regex": search, "$options": "i"}},
{"abstractresource.description": bson.M{"$regex": search, "$options": "i"}},
}},
bson.M{"$or": list},
opts,
); err != nil {
fmt.Println(0, bson.M{"$or": list})
return nil, 404, err
} else {
fmt.Println(cursor, bson.M{"$or": list})
return cursor, 200, nil
}
}