Skip to content

MongoDB persistence in Cratis Arc

Cratis Arc’s MongoDB integration gives commands and queries access to document storage through the MongoDB driver. Add Cratis.Arc.MongoDB to inject typed collections and configure how your .NET types are stored as BSON, MongoDB’s binary document format. You can use it without Chronicle or event sourcing.

Follow getting started to install the package, connect your host to a database, and resolve an IMongoCollection<T>. Get ordinary reads working before adding live queries: those use change streams and need a replica set or sharded cluster with permission to watch the database.

  • Concepts: store strongly typed values without wrapper documents.
  • Serializers: understand BSON representations, including date precision and Guid formats.
  • Naming policies: choose collection and member names before writing data.
  • Class mapping: customize individual document types.
  • Convention packs: apply and filter shared conventions.
  • Geospatial types: store GeoJSON and construct driver query geometry.

Graph data lives in Neo4j rather than MongoDB; the Neo4j integration gives the same tenant-aware convenience for a property graph.

Observation refreshes query results when stored documents change; it is not an event log. Storing a document does not append Chronicle events. If you need event sourcing as well, continue with the separate Chronicle integration.