1.0.10 • Published 4 years ago

@thepuzzlemaker/dbpmstore-mongo v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

DBPMStore MongoDB Driver

A MongoDB driver for DBPMStore. Requires the mongodb NodeJS package during runtime (if using the MongoDB driver), and during compile (if compiling from source).

Example Code:

import {DBPMStorageMongo} from "dbpmstore/drivers/mongo";
const storage = new DBPMStorageMongo({ connectionString: "some connection string", dbName: "db", writeTolerance: 3, collectionName: "collection"}, "document");
const doStuff = async () => {
  try {
    if (await storage.connect()) {
      await storage.write("key", "value");
      console.log(await storage.get("key")) // Console: "value"
      await storage.disconnect();
     } else {
      console.error("Could not connect to the database!");
     }
   } catch (err) {
     console.error(`Error: ${err.stack.trimLeft()}`);
     process.exit(1);
   }
};
doStuff();
1.0.10

4 years ago

1.0.9

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