Disponible
amalgame-mongodb
Binding dynamic-link au mongo-c-driver. Modèle document.
Vue d'ensemble
Le client officiel MongoDB en C (libmongoc + libbson) est lié dynamiquement. L'API expose des documents en JSON in/out — la conversion BSON est gérée sous le capot pour rester ergonomique côté Amalgame.
Caractéristiques
- ✓Binding à
libmongocetlibbsonsystème - ✓API document :
InsertOne,FindMany,UpdateOne,DeleteMany - ✓JSON in/out — pas d'opérateur BSON exotique à apprendre
- ✓Index, agrégats, sessions et transactions
- ✓TLS via la chaîne mongo-c-driver native
Exemple
Exemple minimal d'utilisation — recopiable tel quel après l'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 } })
En bref
- Licence : Apache-2.0
- Installation :
amc package add mongodb - Code source : amalgame-lang/amalgame-database-mongodb
- Index officiel : amalgame-lang/packages-index