fix db
This commit is contained in:
		
							parent
							
								
									5a67e2c377
								
							
						
					
					
						commit
						84e2db1b73
					
				|  | @ -92,16 +92,11 @@ func (s MongoDBStorage) GetEvents(namespaces []string) (events []Event, err erro | |||
| 
 | ||||
| 	for cur.Next(context.TODO()) { | ||||
| 		var event Event | ||||
| 		//var elem bson.M
 | ||||
| 
 | ||||
| 		if err := cur.Decode(&event); err != nil { | ||||
| 			return events, err | ||||
| 		} | ||||
| 
 | ||||
| 		// bsonBytes, _ := bson.Marshal(elem)
 | ||||
| 		// fmt.Println(string(bsonBytes))
 | ||||
| 		// bson.Unmarshal(bsonBytes, &event)
 | ||||
| 
 | ||||
| 		events = append(events, event) | ||||
| 
 | ||||
| 	} | ||||
|  | @ -157,9 +152,6 @@ func (s MongoDBStorage) GetSubscriber(subscriber string) ([]Subscription, error) | |||
| 	subscriptions := []Subscription{} | ||||
| 
 | ||||
| 	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}}}) | ||||
| 	if err != nil { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue