1.4.0 • Published 1 year ago

@chrisaxxwell/merlin-db v1.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Logo

MerlinDB

MerlinDB was developed to simplify and improve the use of the IndexedDB API in web browsers. MerlinDb allows developers to add, get, update and remove data at scale, providing a fluid and effective experience. Inspired by the renowned MongoDB.

Installation

Install merlinDB with npm or download

  npm install @chrisaxxwell/merlin-db

Usage/Examples

import MerlinDB, { Schema } from "@chrisaxxwell/merlin-db";
//Or if you are using 'merlindb.min.js' just call 'new MerlinDB()';

Call the new MerlinDB():

const merlin = new MerlinDB();

Connect to database:

merlin.connect(<YOUR-DATABASE-NAME>);

Create an Schema:

var usersSchema = Schema({
  email: {
    type: String,
    unique: true,
  },
  name: { type: [String], required: true },
  age: [Number, String],
  city: String,
});

Initialize your new model:

const Users = merlin.model("Users", usersSchema);

CRUD (Insert, Update and Remove):

//Insert
Users.insert({ name: "Chris", age: 27 }).then((e) => console.log(e));

//Find
Users.find({ age: 27 }).then((e) => console.log(e));

//Update
Users.updateOne(
  {
    //Every name = Sophie
    name: { $regex: ["Sophie", "i"] },
  },
  { $set: { name: "Lady Sophie" } }
);

//Delete
Users.deleteOne({ name: "Chris" }).then((e) => console.log(e));

Full code:

import MerlinDB, {Schema} from "@chrisaxxwell/merlin-db";

const merlin = new MerlinDB();
merlin.connect(<YOUR-DATABASE-NAME>);

var usersSchema = Schema({
   email: {
      type: String,
      unique: true
   },
   name: { type: [ String ], required: true },
   age: [ Number, String ],
   city: String,
});


Users.insert({ name: "Chris", age: 27 }).then(e => console.log(e));

Users.find({ age: 27 }).then(e => console.log(e));

Users.updateOne({

   name: { $regex: ["Sophie", "i"] } },
   { $set: { name: "Lady Sophie" }
});

Users.deleteOne({ name: "Chris" }).then(e => console.log(e));

Documentation

To see full documentation access https://merlindb.chrisaxxwell.com.

FAQ

- Why MerlinDB?

MerlinDB was carefully developed to simplify and improve the use of the IndexedDB API in web browsers. MerlinDb allows developers to add, get, update and remove data at scale, providing a fluid and effective experience. Inspired by the renowned MongoDB and Mongoose, MerlinDB is a sophisticated and intuitive tool especially designed for those familiar with MongoDB and Mongoose. Its intuitive interface and powerful features make it the ideal choice for professionals looking for superior productivity and performance in their web development projects.

- Where can I see a basic tutorial?

Access https://merlindb.chrisaxxwell.com/docs

- How can I use encryption in merlinDB?

Encrypt: https://merlindb.chrisaxxwell.com/manual/reference/insert/

Decrypt: https://merlindb.chrisaxxwell.com/manual/reference/find/

- How to test quickly??

Encrypt: https://merlindb.chrisaxxwell.com/admin/

- Its free?

YUP totally free

Color Reference

ColorHex
color-1#250649 #250649
color-2#2d0c55 #2d0c55
color-3#3f1e71 #3f1e71

Authors

Feedback

If you have any feedback, please reach out to us at chrisaxxwell@gmail.com

Support

For support, email chrisaxxwell@gmail.com or join our Slack channel.

License

MIT

1.4.0

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.0

1 year ago

1.1.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago