diff --git a/dbs/mongo/mongo.go b/dbs/mongo/mongo.go index 8b4b672..5a1f2e5 100644 --- a/dbs/mongo/mongo.go +++ b/dbs/mongo/mongo.go @@ -207,7 +207,7 @@ func (m *MongoDB) StoreOne(obj interface{}, id string, collection_name string) ( bson.Unmarshal(b, &doc) doc["_id"] = id targetDBCollection := CollectionMap[collection_name] - fmt.Println("DB", targetDBCollection) + fmt.Println("DB", collection_name, targetDBCollection, CollectionMap) MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second) defer cancel() @@ -253,10 +253,7 @@ func (m *MongoDB) Search(search string, filter []string, collection_name string) if cursor, err := targetDBCollection.Find( MngoCtx, - bson.M{"$or": []bson.M{ - {"name": bson.M{"$regex": search, "$options": "i"}}, - {"description": bson.M{"$regex": search, "$options": "i"}}, - }}, + bson.M{"name": bson.M{"$regex": search, "$options": "i"}}, opts, ); err != nil { fmt.Println(0, bson.M{"$or": list})