Available
amalgame-mongodb
Dynamic-link binding to the mongo-c-driver. Document model.
Overview
The official MongoDB C client (libmongoc + libbson) is linked dynamically. The API surfaces documents as JSON in/out — BSON conversion is handled under the hood to stay ergonomic on the Amalgame side.
Features
- ✓Binding to system
libmongocandlibbson - ✓Document API:
InsertOne,FindMany,UpdateOne,DeleteMany - ✓JSON in/out — no exotic BSON operator to learn
- ✓Indexes, aggregates, sessions and transactions
- ✓TLS via the native mongo-c-driver chain
Example
Minimal usage example — copy-paste runnable after install.
amc package add mongodb
let mc = MongoClient.Connect("mongodb://localhost:27017")
let users = mc.Collection("app", "users")
users.InsertOne({ name: "Alice", age: 30 })
let adults = users.FindMany({ age: { "$gte": 18 } })
At a glance
- License: Apache-2.0
- Install:
amc package add mongodb - Source: amalgame-lang/amalgame-database-mongodb
- Official index: amalgame-lang/packages-index