1.2.4 • Published 4 years ago

salvage.db v1.2.4

Weekly downloads
176
License
ISC
Repository
github
Last release
4 years ago

Salvage.DB

Salvage.DB is a fast, lightweight, easy-to-use database. It was created by Salvage_Dev.

About

Salvage.DB can help you in many ways:

  • Save data to MongoDB in seconds - Using this database, you can save data to your database in seconds! Add new Schemas/Collections to your MongoDB Atlas in the blink of an eye!
  • Fast and lightweight - Compared to databases like quick.db, salvage.db is the flash! It is much easier to use and doesn't have a lot of folders, making it very compact!
  • Easy to use - Making a new client and saving data is very easy! You can do it in seconds!

Installation

To install Salvage.DB, simply run this command in the terminal:

npm i salvage.db

Examples

If you do not know how to use Salvage.DB, follow the examples below to get you started!

Creating a Client

To create a new MongoDB Client, use this code:

Create Client

This will save the data that you have inputted through your database. This will save a new Schema/Collection into your MongoDB Atlas, with the properties in the "schema". This means the name would be the name inputted in "name" and the MongoURI would be "mongoURI". The last line waits until it connects to your database, and after it has done that, it saves all the data.

Setting and Getting Data

Here are some examples to introduce you to setting, getting, and finding values.

Setting getting hasing data This example saves the key of "Key1" with the value of "Value" to the database. Then, it will console.log "Value" as that is the value of the key. When awaiting db.has it will return true or false. In this example it would console.log true, as Key1 exists. It would then console.log false as Key2 does not exist.

Dependencies

Salvage.DB has 2 Dependencies:

  1. Mongoose
  2. This.db Update: 19/06/2020 Added the long awaited db.cached! This will return all data stored, and if it get's deleted, it will be deleted from the cache. This will actually make the getting route faster, as if it is cached we can fetch it much quicker. New methods:
await db.clearCache(); //Clear the cache

Thank you.

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago