init
This commit is contained in:
		
							parent
							
								
									5feb1b720e
								
							
						
					
					
						commit
						ffa341b13d
					
				| 
						 | 
				
			
			@ -120,3 +120,13 @@ func (s MongoDBStorage) AddSubscription(eventid string, subscription Subscriptio
 | 
			
		|||
	_, err := collection.UpdateOne(context.TODO(), filter, push)
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (s MongoDBStorage) RemoveSubscription(subscriptionid string, subscription Subscription) error {
 | 
			
		||||
	collection := s.Client.Database(s.DbName).Collection(s.Collections["events"])
 | 
			
		||||
 | 
			
		||||
	filter := bson.M{"_id": subscriptionid}
 | 
			
		||||
	push := bson.M{"$pull": bson.M{"subscriptions": subscription}}
 | 
			
		||||
 | 
			
		||||
	_, err := collection.UpdateOne(context.TODO(), filter, push)
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue