Skip to content

Commit bc3ce63

Browse files
committed
v0.2.1
1 parent baf5a83 commit bc3ce63

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

README.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Inspired by NeDB, DnDB is a powerful but minimalist database engine written on J
1010
1111
## Why DnDB?
1212

13-
DnDB is an incredibly fast and powerful data store. All methods are streamed and buffered to optimize data reading and writing. DnDB is not only faster, but it consumes less resources (RAM) since only a small portion of the data stream is stored in memory by the buffer.
13+
DnDB is an incredibly fast and powerful data store. All methods are streamed and buffered to optimize data reading/writing. DnDB is not only faster, but it consumes less resources (RAM) since only a small portion of the data stream is stored in memory by the buffer, enabling optimal performance on large data collections.
1414

1515
## 🧪 Quick test
1616

@@ -19,7 +19,7 @@ DnDB is an incredibly fast and powerful data store. All methods are streamed and
1919
## 📦 Importing
2020

2121
```javascript
22-
import Datastore from 'https://x.nest.land/dndb@0.2.0/mod.ts'
22+
import Datastore from 'https://x.nest.land/dndb@0.2.1/mod.ts'
2323
```
2424

2525
## 📖 Usage
@@ -38,7 +38,7 @@ All the api methods are asynchronous by default, so they return promises, but it
3838
## ✔️ Instantiating the collection
3939

4040
```javascript
41-
import Datastore from 'https://x.nest.land/dndb@0.2.0/mod.ts'
41+
import Datastore from 'https://x.nest.land/dndb@0.2.1/mod.ts'
4242

4343
const db = new Datastore({ filename:"./database.db", autoload: true })
4444

@@ -172,6 +172,10 @@ To update documents DnDB exposes the method:
172172

173173
- returns: array with the new updated collection
174174

175+
- `updateOne`
176+
177+
- returns: object with the new updated document.
178+
175179
The update method follows the same query rules as in `find` and `findOne` at first argument to get the update target document and as a second agument it receives the aggregation operators that modifies the matching fileds values ​​by following the aggregation rules.
176180

177181
> *Notice*: See all rules and operators list [here](https://www.npmjs.com/package/mingo)
@@ -192,7 +196,11 @@ To remove documents DnDB exposes the method:
192196

193197
- `remove`
194198

195-
- returns: array with the new updated collection
199+
- returns: array with the new removed collection
200+
201+
- `removeOne`
202+
203+
- returns: object with the new removed document
196204

197205
The remove method follows the same query rules as in `find` and `findOne` at first argument, it will remove all the documents that matches the query.
198206

@@ -210,7 +218,7 @@ await remove({ _id: 'id2' })
210218
211219
# 📝 TO DO
212220

213-
- Event hooks on all the api usage.
221+
- Event hooks on all the api usage
214222
- Count method
215223
- Improve documentation
216224
- Prevent updating inmutable data

src/storage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const encoder = new TextEncoder();
22
const decoder = new TextDecoder('utf-8');
33
import { EventEmitter } from "https://deno.land/std/node/events.ts";
4-
import { BufReader, BufWriter } from "https://deno.land/std/io/bufio.ts";
4+
import { BufReader } from "https://deno.land/std/io/bufio.ts";
55
import { existsSync } from "https://deno.land/std/fs/mod.ts";
66

77
// Ensure datastore initialization on first load

0 commit comments

Comments
 (0)