Let use a custom name for Outbox and Snapshots collections.
Affected Components
mongodb.Outbox
mongodb_v2.EventStore
Related Issues
None
Solution and Design
This is a replication of the available functionality to set event and streams collection names.
Added an Option to set the custom name:
outbox.WithCollectionNames
mongodb_v2.WithSnapshotCollectionName
The WithSnapshotCollectionName is added to kepp compatibility with exitent WithtCollectionName (and because I want to review if Snapshot should be part of this EventStore or should be another store).
Steps to test and verify
Create an event store with custom name: NewEventStore(url, db, WithSnapshotCollectionName("foo"))
Check in database the collection created is foo
Create an outbox with custom name: NewOutbox(url, db, WithCollectionName("foo-outbox"))
Check in database the collection created is foo-outbox
coverage: 67.237% (-0.4%) from 67.599% when pulling 337e2a331d516e54cfa4c78026be37f52ab9c1f7 on AltScore:feature/let-set-collection-names into 599169c1c4a89dc57954d5b871cd482b4c4ad02c on looplab:main.
Description
Let use a custom name for Outbox and Snapshots collections.
Affected Components
Related Issues
None
Solution and Design
This is a replication of the available functionality to set event and streams collection names.
Added an Option to set the custom name:
The WithSnapshotCollectionName is added to kepp compatibility with exitent WithtCollectionName (and because I want to review if Snapshot should be part of this EventStore or should be another store).
Steps to test and verify
Create an event store with custom name:
NewEventStore(url, db, WithSnapshotCollectionName("foo"))
Check in database the collection created is
foo
Create an outbox with custom name:
NewOutbox(url, db, WithCollectionName("foo-outbox"))
Check in database the collection created is
foo-outbox