arangoose
v0.1.2
Published
Mongoose-like ODM for ArangoDB
Maintainers
Readme
Arangoose
Mongoose-like ODM for ArangoDB. Arangoose provides a straight-forward, schema-based solution to model your application data with ArangoDB. It includes built-in type casting, validation, query building, business logic hooks, and more, out of the box.
THIS IS A WIP - Just in dev phase for now. If you'd like to contribute please open a PR or feel free to fork .
Installation
npm install arangooseRequirements
- Node.js 14.x or higher
- ArangoDB 3.8 or higher
Quick Start
const arangoose = require('arangoose');
// Connect to ArangoDB
await arangoose.connect('http://localhost:8529', {
database: 'mydb',
username: 'root',
password: 'password'
});
// Define a schema
const userSchema = new arangoose.Schema({
name: { type: String, required: true },
email: { type: String, required: true, unique: true },
age: { type: Number, min: 18 },
createdAt: { type: Date, default: Date.now }
});
// Create a model
const User = arangoose.model('User', userSchema);
// Create a document
const user = new User({
name: 'John Doe',
email: '[email protected]',
age: 30
});
// Save to database
await user.save();
// Find documents
const users = await User.find({ age: { $gte: 21 } });Documentation
Testing
npm testLicense
MIT
