More data on subscriptions
This commit is contained in:
@@ -111,11 +111,11 @@ func (s MongoDBStorage) GetEvents(namespaces []string) (events []Event, err erro
|
||||
return
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) AddSubscriber(eventid string, subscriber string) error {
|
||||
func (s MongoDBStorage) AddSubscription(eventid string, subscription Subscription) error {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["events"])
|
||||
|
||||
filter := bson.M{"_id": eventid}
|
||||
push := bson.M{"$push": bson.M{"subscribers": subscriber}}
|
||||
push := bson.M{"$push": bson.M{"subscriptions": subscription}}
|
||||
|
||||
_, err := collection.UpdateOne(context.TODO(), filter, push)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user