用于 Node.js 的轻量级 Javascript DB

发布于 2024-12-01 20:24:00 字数 1539 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(11

哆啦不做梦 2024-12-08 20:24:00

我和你有同样的需求,但找不到合适的数据库。 nStore 很有前途,但 API 还不够完整,而且不太连贯。

这就是我制作 NeDB 的原因,它是 Node.js 项目的无依赖嵌入式数据库。您可以通过简单的 require() 来使用它,它是持久性的,并且它的 API 是非常著名的 MongoDB API 中最常用的子集。

https://github.com/louischatriot/nedb

I had the same requirements as you but couldn't find a suitable database. nStore was promising but the API was not nearly complete enough and not very coherent.

That's why I made NeDB, which a dependency-less embedded database for Node.js projects. You can use it with a simple require(), it is persistent, and its API is the most commonly used subset of the very well-known MongoDB API.

https://github.com/louischatriot/nedb

瑾兮 2024-12-08 20:24:00

Lokijs:用于 Node.js、浏览器和 cordova 的快速、内存中面向文档的数据存储。

  • 内存中 Javascript 数据存储,具有持久性
  • 浏览器内 NoSQL 数据库,可同步和持久保存
  • Redis 风格的存储,可通过 npm 安装
  • 用于 Cordova 的持久 NoSQL 数据库
  • 具有 Node-webkit 持久性的嵌入式 NoSQL 数据库

LokiJS 是理想的解决方案:

  • 移动应用程序 - 尤其是基于 HTML5(Cordova、Phonegap、
    等)
  • 适用于中小型应用程序的 Node.js 嵌入式数据存储
  • 使用 Node Webkit 嵌入桌面应用程序

https://github .com/techfort/LokiJS

Lokijs: A fast, in-memory document-oriented datastore for node.js, browser and cordova.

  • In-memory Javascript Datastore wih Persistence
  • In-Browser NoSQL db with syncing and persisting
  • a Redis-style store an npm install away
  • Persistable NoSQL db for Cordova
  • Embeddable NoSQL db with Persistence for node-webkit

LokiJS to be the ideal solution:

  • Mobile applications - especially HTML5 based (Cordova, Phonegap,
    etc.)
  • Node.js embedded datastore for small-to-medium apps
  • Embedded in desktop application with Node Webkit

https://github.com/techfort/LokiJS

西瓜 2024-12-08 20:24:00

NeDB 似乎就是您正在寻找的东西。从简介中:

Node.js 的嵌入式持久数据库,用 Javascript 编写,没有依赖项(当然 npm 模块除外)。您可以将其视为 Node.js 项目的 SQLite,可以与简单的 require 语句一起使用。该 API 是 MongoDB 的子集。您可以将其用作持久数据存储或仅内存中的数据存储。

NeDB seems to be what you are looking for. From the blurb:

Embedded persistent database for Node.js, written in Javascript, with no dependency (except npm modules of course). You can think of it as a SQLite for Node.js projects, which can be used with a simple require statement. The API is a subset of MongoDB's. You can use it as a persistent or an in-memory only datastore.

心碎的声音 2024-12-08 20:24:00

看看 http://www.tingodb.com。我相信它能满足您的需求。此外,它与 MongoDB API 完全兼容。这降低了实施风险,并让您可以选择随着应用程序的增长而切换到重型解决方案。

https://github.com/sergeyksv/tingodb

Take a look at http://www.tingodb.com. I believe it does what you looking for. Additionally it fully compatible with MongoDB API. This reduces implementation risks and gives you option to switch to heavy solution as your app grows.

https://github.com/sergeyksv/tingodb

涫野音 2024-12-08 20:24:00

我只熟悉 Mongo 和 Couch,但还有一个名为 Persistence

I'm only familiar with Mongo and Couch, but there's also one named Persistence.

半步萧音过轻尘 2024-12-08 20:24:00

尝试一下 nStore,它似乎是一个不错的用于节点的键/值轻量级嵌入式数据库。
请参阅https://github.com/creationix/nstore

Try nStore, it seems like a nice key/value lightweight dembedded db for node.
See https://github.com/creationix/nstore

早乙女 2024-12-08 20:24:00

我在使用 SQLite3、nStore 和 Alfred 时遇到了麻烦。

对我有用的是 node-dirty

path = "#{__dirname}/data/messages.json"
messages = db path

message = 'text': 'Lorem ipsum dolor sit...'

messages.on "load", ->    
    messages.set 'my-unique-key', message, ->
        console.log messages.get('my-unique-key').text

    messages.forEach (key, value) ->
        console.log "Found key: #{key}, val: %j", value

messages.on "drain", ->
    console.log "Saved to #{path}"

I had trouble with SQLite3, nStore and Alfred.

What works for me is node-dirty:

path = "#{__dirname}/data/messages.json"
messages = db path

message = 'text': 'Lorem ipsum dolor sit...'

messages.on "load", ->    
    messages.set 'my-unique-key', message, ->
        console.log messages.get('my-unique-key').text

    messages.forEach (key, value) ->
        console.log "Found key: #{key}, val: %j", value

messages.on "drain", ->
    console.log "Saved to #{path}"
℡Ms空城旧梦 2024-12-08 20:24:00

LevelUP 旨在以 Node.js 友好的方式公开 LevelDB 的功能。

https://github.com/rvagg/node-levelup

您还可以查看 UnQLite。使用 node.js 绑定 node-unqlite

https://github.com/symisc/unqlite

LevelUP aims to expose the features of LevelDB in a Node.js-friendly way.

https://github.com/rvagg/node-levelup

You can also look at UnQLite. with a node.js binding node-unqlite

https://github.com/symisc/unqlite

一身仙ぐ女味 2024-12-08 20:24:00

也许你应该尝试 LocallyDB 它除了具有类似于以下的高级选择系统之外,还易于使用且轻量级JavaScript 条件表达式...

https://github.com/btwael/locallydb

Maybe you should try LocallyDB it's easy-to-use and lightweight in addition to the with advanced selecting system similar to javascript conditional expression...

https://github.com/btwael/locallydb

无尽的现实 2024-12-08 20:24:00

我编写了 jaguarDb 来处理您提到的一些事情,因为我有时也需要一个“小”数据库用于演示或测试项目,并且我不想依赖 mongoDB 或另一个真实的数据库。

https://github.com/hectorcorrea/jaguarDb

I wrote jaguarDb to handle some of the things that you are mentioning since I sometimes need a "little" database for demo or test projects too and I don't want to depend on mongoDB or another real database.

https://github.com/hectorcorrea/jaguarDb

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文