NeDB Node 嵌入式数据存储开源项目

我要开发同款
匿名用户2014年03月18日
118阅读

技术信息

开源地址
https://github.com/louischatriot/nedb
授权协议
MIT

作品详情

Node.js实现的嵌入式数据存储,可以部分或全部替代sqlite数据库。可以当内存数据库使用也可本地存储。

NEDB采用非常灵活的查询方式,让你几乎可以忘记他是非关系数据库:

 (1) 可以使用正则查询

 (2) ad or where  大于 小于 排序等 

 (3) 索引

数据存储采用JSON新式,可以深度查询。

eg:

// Let's say our datastore cotais the followig collectio

 

{ _id: 'id5', completeData: { plaets: [ { ame: 'Earth', umber: 3 }, { ame: 'Mars', umber: 2 }, { ame: 'Pluto', umber: 9 } ] } }db.fid({ "completeData.plaets.0.ame": "Earth" }, fuctio (err, docs) { // docs cotais documet 5 // If we had tested agaist "Mars" docs would be empty because we are matchig agaist a specific array elemet });

语法和MogoDB非常相似.

Speed

Isert:5,950ops/s

Fid:25,440ops/s

Update:4,490ops/s

Remove:6,620ops/s

Memoryfootprit

Acopyofthewholedatabaseiskeptimemory.Thisisotmuchotheexpectedkidofdatasets(20MBfor10,0002KBdocumets).Ifrequested,I'llitroduceaoptiotootusethiscachetodecreasememoryfootprit(atthecostofalowerspeed).

缺点:数据加载在内存中进行操作,不适合内存非常紧张的应用。目前作者没有给出细腻度的内存控制方法。

功能介绍

Node.js 实现的嵌入式数据存储,可以部分或全部替代sqlite数据库。可以当内存数据库使用也可本地存储。 NEDB采用非常灵活的查询方式,让你几乎可以忘记他是非关系数据库: (1) 可以使...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论