test on nested search
This commit is contained in:
parent
5ab011844d
commit
4730d5b4d4
@ -253,7 +253,10 @@ func (m *MongoDB) Search(search string, filter []string, collection_name string)
|
|||||||
|
|
||||||
if cursor, err := targetDBCollection.Find(
|
if cursor, err := targetDBCollection.Find(
|
||||||
MngoCtx,
|
MngoCtx,
|
||||||
bson.M{"name": bson.M{"$regex": search, "$options": "i"}},
|
bson.M{"$or": []bson.M{
|
||||||
|
{"abstractresource.abstractobject.name": bson.M{"$regex": search, "$options": "i"}},
|
||||||
|
{"abstractresource.description": bson.M{"$regex": search, "$options": "i"}},
|
||||||
|
}},
|
||||||
opts,
|
opts,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
fmt.Println(0, bson.M{"$or": list})
|
fmt.Println(0, bson.M{"$or": list})
|
||||||
|
Loading…
Reference in New Issue
Block a user