MongoDB feature

The mongodb feature adds a MongoDB document database client wired into the composition root. Use it for document storage or workloads that fit a NoSQL data model.

What it provides

File Purpose
internal/adapters/persistence/mongodb/client.go Mongo client connection wired as mdb

Access the database through the wired client:

db := mdb.Client().Database("myapp")
collection := db.Collection("documents")

Tech stack

Library Purpose Documentation
MongoDB Go Driver Official MongoDB driver mongodb.com/docs/drivers/go
MongoDB Document database mongodb.com/docs

Learning resources

Notes

  • Connection settings are configurable in configs/config.yaml under the mongodb section.
  • The client uses the standard mongo.Connect with configurable URI, credentials, and timeouts.
  • For local development, start MongoDB with Docker: docker run -p 27017:27017 mongo.