This commit is contained in:
soukainna 2025-02-12 11:05:24 +01:00
parent 5a67e2c377
commit 84e2db1b73
1 changed files with 0 additions and 8 deletions

View File

@ -92,16 +92,11 @@ func (s MongoDBStorage) GetEvents(namespaces []string) (events []Event, err erro
for cur.Next(context.TODO()) { for cur.Next(context.TODO()) {
var event Event var event Event
//var elem bson.M
if err := cur.Decode(&event); err != nil { if err := cur.Decode(&event); err != nil {
return events, err return events, err
} }
// bsonBytes, _ := bson.Marshal(elem)
// fmt.Println(string(bsonBytes))
// bson.Unmarshal(bsonBytes, &event)
events = append(events, event) events = append(events, event)
} }
@ -157,9 +152,6 @@ func (s MongoDBStorage) GetSubscriber(subscriber string) ([]Subscription, error)
subscriptions := []Subscription{} subscriptions := []Subscription{}
var cur *mongo.Cursor var cur *mongo.Cursor
// findOptions := options.Find()
// cur, err := collection.Find(context.TODO(), bson.M{"subscriptions": subscriber}, findOptions)
cur, err := collection.Find(context.TODO(), bson.M{"subscriptions": bson.M{"$elemMatch": bson.M{"subscriber": subscriber}}}) cur, err := collection.Find(context.TODO(), bson.M{"subscriptions": bson.M{"$elemMatch": bson.M{"subscriber": subscriber}}})
if err != nil { if err != nil {