klauz-db 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +59 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,4 @@
1
- <!-- # KlauzDB [![NPM version](https://img.shields.io/npm/v/klauz-db.svg?style=flat-square)](https://www.npmjs.com/package/klauz-db) -->
2
- # KlauzDB [![NPM version]]
1
+ # KlauzDB [![NPM version](https://img.shields.io/npm/v/klauz-db.svg?style=flat-square)](https://www.npmjs.com/package/klauz-db)
3
2
 
4
3
  KlauzDB é um banco de dados orientado a collections projetado para oferecer uma solução leve e eficiente para a persistência de dados locais. Utilizando arquivos .json como seu meio de armazenamento, ele permite que desenvolvedores manipulem dados estruturados de maneira intuitiva e acessível.
5
4
 
@@ -530,4 +529,61 @@ console.log("collection.findAll(): ", collection.findAll());
530
529
  ]
531
530
  //
532
531
  ```
533
- <br>
532
+ <br>
533
+
534
+ ### reset
535
+ Apaga todos os dados inseridos na Collection.
536
+
537
+ #### Syntax
538
+ ```js
539
+ collection.reset()
540
+ ```
541
+
542
+ #### Retorno
543
+ Não possui retorno;
544
+
545
+ #### Exemplo
546
+ ```js
547
+ // Adicionando dados
548
+ collection.addMany([
549
+ {
550
+ nome: 'User_1',
551
+ admin: false
552
+ },
553
+ {
554
+ nome: 'User_2',
555
+ admin: false
556
+ }
557
+ ])
558
+
559
+
560
+ // Resetando os dados
561
+
562
+ console.log("collection.findAll(): ", collection.findAll());
563
+ // Consulta antes:
564
+ [
565
+ {
566
+ "nome": "User_1",
567
+ "admin": false,
568
+ "_zid": 1
569
+ },
570
+ {
571
+ "nome": "User_2",
572
+ "admin": false,
573
+ "_zid": 2
574
+ }
575
+ ]
576
+ //
577
+
578
+ collection.reset()
579
+
580
+ console.log("collection.findAll(): ", collection.findAll());
581
+ // Consulta depois:
582
+ []
583
+ //
584
+ ```
585
+ <br>
586
+
587
+ ## ✒️ Autores
588
+
589
+ * **Desenvolvedor** - *Trabalho & Documentação* - [Victor Nikolaus](https://github.com/vnikolaus)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "klauz-db",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Um banco de dados simples, para aplicações com um grau menor de complexidade",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {