企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] > [home](https://erikolson186.github.io/zangodb/index.html) ## 概述 类似 MongoDB 的 IndexedDB 接口,支持 MongoDB 的大多数熟悉的过滤、投影、排序、更新和聚合功能。 ## demo ``` let db = new zango.Db('mydb', { people: ['age'] }); let people = db.collection('people'); let docs = [ { name: 'Frank', age: 20 }, { name: 'Thomas', age: 33 }, { name: 'Todd', age: 33 }, { name: 'John', age: 28 }, { name: 'Peter', age: 33 }, { name: 'George', age: 28 } ]; people.insert(docs).then(() => { return people.find({ name: { $ne: 'John' }, age: { $gt: 20 } }).group({ _id: { age: '$age' }, count: { $sum: 1 } }).project({ _id: 0, age: '$_id.age' }).sort({ age: -1 }).forEach(doc => console.log('doc:', doc)); }).catch(error => console.error(error)); ```