public void DeleteStream(string bucketId, string streamId)
        {
            Logger.Warn(Messages.DeletingStream, streamId, bucketId);
            TryMongo(() =>
            {
                PersistedStreamHeads.Remove(
                    Query.EQ(MongoStreamHeadFields.Id, new BsonDocument {
                    { MongoStreamHeadFields.BucketId, bucketId },
                    { MongoStreamHeadFields.StreamId, streamId }
                })
                    );

                PersistedSnapshots.Remove(
                    Query.EQ(MongoShapshotFields.Id, new BsonDocument {
                    { MongoShapshotFields.BucketId, bucketId },
                    { MongoShapshotFields.StreamId, streamId }
                })
                    );

                PersistedCommits.Update(
                    Query.And(
                        Query.EQ(MongoCommitFields.BucketId, bucketId),
                        Query.EQ(MongoCommitFields.StreamId, streamId)
                        ),
                    Update.Set(MongoCommitFields.BucketId, MongoSystemBuckets.RecycleBin),
                    UpdateFlags.Multi
                    );
            });
        }
Пример #2
0
 public void DeleteStream(string bucketId, string streamId)
 {
     Logger.Warn(Messages.DeletingStream, streamId, bucketId);
     TryMongo(() =>
     {
         PersistedStreamHeads.Remove(Query.And(Query.EQ("_id.BucketId", bucketId), Query.EQ("_id.StreamId", streamId)));
         PersistedSnapshots.Remove(Query.And(Query.EQ("_id.BucketId", bucketId), Query.EQ("_id.StreamId", streamId)));
         PersistedCommits.Remove(Query.And(Query.EQ("_id.BucketId", bucketId), Query.EQ("_id.StreamId", streamId)));
     });
 }
 public void Purge(string bucketId)
 {
     Logger.Warn(Messages.PurgingBucket, bucketId);
     TryMongo(() =>
     {
         PersistedStreamHeads.Remove(Query.EQ(MongoStreamHeadFields.FullQualifiedBucketId, bucketId));
         PersistedSnapshots.Remove(Query.EQ(MongoShapshotFields.FullQualifiedBucketId, bucketId));
         PersistedCommits.Remove(Query.EQ(MongoCommitFields.BucketId, bucketId));
     });
 }
Пример #4
0
 public void Purge(string bucketId)
 {
     Logger.Warn(Messages.PurgingBucket, bucketId);
     TryMongo(() =>
     {
         PersistedStreamHeads.Remove(Query.EQ("_id.BucketId", bucketId));
         PersistedSnapshots.Remove(Query.EQ("_id.BucketId", bucketId));
         PersistedCommits.Remove(Query.EQ("_id.BucketId", bucketId));
     });
 }