anodesdb
v1.0.6
Published
High-performance Distributed Document Clusters for the ANodes Database Ecosystem.
Maintainers
Readme
ANodes SDK (anodesdb)
The official high-performance Node.js interface for managing distributed JSON clusters on the ANodes Database.
New
The latest version of anodesdb comes with:
- HTTP Keep-Alive: Persistent connections to the infrastructure for lower latency.
- Mutations: Server-side updates ($inc, $push) replace slow client-side loops.
- Bulk Operations: Process thousands of documents in a single HTTP request.
Quick Start
npm install anodesdbconst { AnodesDB } = require('anodesdb');
const db = new AnodesDB({
apiKey: 'your-api-key', // Dashboard → Database Access
projectId: 'your-project-id', // Your Cluster ID
baseUrl: 'https://database.anodes.dev'
});
const users = db.collection('users');
// 1. Counter Update (Server-side)
await users.update('doc-123', { $inc: { balance: 100 } });
// 2. Advanced Query
const players = await users.find({
level: { $gt: 10 },
username: { $regex: '^Andrei', $options: 'i' }
}, {
projection: { username: 1, level: 1 },
limit: 10
});
// 3. Bulk Operations
await users.insert([
{ id: '1', rank: 'MVP' },
{ id: '2', rank: 'Legend' }
]);API Reference
Write Operations
insert(data|data[])— Single or Bulk Insert. Processes arrays 10x faster.update(id, updates)— Atomic mutation using$set,$inc,$push,$pull, or$unset.increment(id, { field: n })— Sugar for$inc.push(id, { field: val })— Sugar for$push(atomic array append).pull(id, { field: val })— Sugar for$pull(atomic array remove).
Read Operations
find(filter?, options?)— Search results. Supports advanced operators ($gt,$lt,$regex,$exists).options.projection—{ field: 1 }to download only specific parts of the JSON.options.limit/options.skip— Pagination controls.
findOne(filter)/findById(id)— Single document lookups.
Delete Operations
delete(id)— Per-document deletion.deleteMany(filter)— Bulk Purge. Deletes all matching documents in a single request.
📊 ANodes Aggregation Engine (Advanced)
Perform complex server-side data analytics using our high-performance aggregation engine. This is significantly faster than fetching all documents and processing them locally.
const warnings = db.collection('warnings');
// Top 5 users with most warnings
const leaderboard = await warnings.aggregate([
{ $group: { _id: "$userId", total: { $sum: 1 } } },
{ $sort: { total: -1 } },
{ $limit: 5 }
]);🔐 Security & Performance
- NoSQL Injection Guard: All inputs are recursively sanitized to prevent operator abuse.
- Bulk Chunking: The library handles massive bulk operations by chunking them into batches of 20 (or 100 for Enterprise) to ensure server stability.
- Project-Level Schema: Set integrity rules in the dashboard for automatic data validation.
Cluster Snapshotting
// Create a full point-in-time backup of the cluster environment
const snap = await db.backups.create('Pre-Patch Snapshot');
// Roll back all collections to a specific backup state
await db.backups.restore(snap.backupId);🌐 Links
- Official Dashboard: anodes.dev/database
- Community Support: Join Discord
⚖️ License
MIT — © 2025-2026 ANodes Hosting
