1.0.0 • Published 1 year ago

dollphin v1.0.0

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

Dollphin

A super basic database. This package can store some BSON documents.

import { Dollphin } from "dollphin";

const database = new Dollphin();

database.createCollection("users");
database.writeDocument("users/1", {
    firstName: "John",
    lastName: "David",
    age: 18,
});
database.writeDocument("users/2", {
    firstName: "David",
    lastName: "Lee",
    age: 52,
});

console.log(database.readDocument("users/1")); // { firstName: 'John', lastName: 'David', age: 18 }
console.log(database.readDocument("users/2")); // { firstName: 'David', lastName: 'Lee', age: 52 }

// Change a field
database.writeDocument(
    "users/2",
    {
        age: 42,
    },
    { merge: true }
);

console.log(database.readDocument("users/2")); // { firstName: 'David', lastName: 'Lee', age: 42 }
1.0.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago