Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View event data in MongoDB Compass as JSON #31

Closed
1 task done
bounoable opened this issue Mar 29, 2022 · 1 comment
Closed
1 task done

View event data in MongoDB Compass as JSON #31

bounoable opened this issue Mar 29, 2022 · 1 comment

Comments

@bounoable
Copy link
Contributor

bounoable commented Mar 29, 2022

Summary

Provide a JSON view of event data in a MongoDB event store.

Motivation

During development or debugging, developers often need to view the event data of stored events. This is currently not possible through MongoDB Compass because the event data is stored in binary:

Bildschirmfoto 2022-03-29 um 19 30 58

In order to view the event data, the developer would have to write a program that fetches the event from the store and decodes it using the registered decoder.

Storing the event data directly as JSON into the store is not an option because it is not guaranteed that events are encoded/decoded as JSON.

Proposal

Proposal is to implement a service that builds an eventually consistent JSON view of all events in the event store within a separate collection/database. If a developer requires a JSON view, the service can be easily added to an application and MongoDB Compass can still be used as the UI to search through the events.

package example

func example(store event.Store, bus event.Bus, col *mongo.Collection) {
  // use the events in `store` to fill the JSON view collection `col` on startup.
  // continuously build the view of published events by subscribing to `bus`.
  svc := jsonview.New(store, bus, col)

  errs, err := svc.Run(context.TODO())
}

Tasks

To be able to use the projection scheduling system within the JSON view builder, the scheduling system needs to be extended to allow for wildcard event subscriptions (because the view builder must subscribe to all events).

@bounoable
Copy link
Contributor Author

Superseded by #112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant