Have ideas to improve npm?Join in the discussion! »

    @dabblelab/dialogdb

    0.0.1-beta.4 • Public • Published

    DialogDB NodeJS

    A persistent data storage and state management solution designed for conversational apps.

    Requirements

    Install

    $ npm install @dabblelab/dialogdb

    Usage

    const DialogDB = require('@dabblelab/dialogdb');

    Get an API Key

    DialogDB.sendApiKey('<your-email-address>').then((apikey) => {     
        console.log(apikey);
     }).catch((error) => {
         console.log(error.message);
    })
    const client = new DialogDB.DialogDBApiClient({
        apiKey : "<your-apikey>",
        tableName : <your-tablename>"
    });

    Find Query

    client.find({})
        .then((data) => {
            console.log(data);
        })
        .catch(error => console.log(error));

    Note

    DialogDB supports the syntax used for MongoDB find query

    Insert Query

    client.insert(
        { 
            item: "card", 
            qty: 15 
        })
        .then((data) => {
            console.log(data);
        })
        .catch(error => console.log(error));

    Note

    DialogDB supports the syntax used for MongoDB insertOne query

    Update Query

    client.update(
        {
            item: "card"
        }, 
        {
            $set : 
            {
                qty: 40
            }
        })
        .then((data) => {
            console.log(data);
        })
        .catch(error => console.log(error));

    Note

    DialogDB supports the syntax used for MongoDB updateMany query

    Remove Query

    client.remove(
        {
            item: "card"
        })
        .then((data) => {
            console.log(data);
        })
        .catch(error => console.log(error));

    Note

    DialogDB supports the syntax used for MongoDB deleteMany query

    Count Query

    client.count({}, {})
        .then((data) => {
            console.log(data);
        })
        .catch(error => console.log(error));

    Note

    DialogDB supports the syntax used for MongoDB countDocuments query

    Keywords

    none

    Install

    npm i @dabblelab/dialogdb

    DownloadsWeekly Downloads

    0

    Version

    0.0.1-beta.4

    License

    ISC

    Unpacked Size

    12.9 kB

    Total Files

    10

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar