@dabblelab/dialogdb
v0.0.1-beta.4
Published
A persistent data storage and state management solution designed for conversational apps.
Downloads
1
Readme
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