An engine in your app.
Use the Go API directly. No server process or network connection required.
Import the embedded package
go get github.com/mammothengine/mammoth@v0.1.0-betaThe default branch’s embedded API exposes Open, Database and Collection. Check the selected release for the same API; the snippet below follows the linked source snapshot.
package main
import (
"log"
mammoth "github.com/mammothengine/mammoth/embed"
)
func main() {
db, err := mammoth.Open("./data")
if err != nil { log.Fatal(err) }
defer db.Close()
projects := db.Database("workspace").Collection("projects")
log.Printf("Collection: %s", projects.Name())
}Choose embedded when locality matters
Desktop applications, development tools and self-contained Go services can access the engine directly. Your application owns the database lifecycle and must close it cleanly.
Understand the API boundary
The embedded package works with Mammoth BSON documents rather than the official MongoDB driver’s collection objects. Its operation signatures are defined in the source. Server-side authentication, network TLS and wire-protocol behavior are separate concerns.
For applications in other languages, start with the standalone server and a MongoDB-compatible driver.
Grounded in the upstream source · snapshot 6b186803 · reviewed 19 October 2026.
Embedded API Embedded tests