New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

thinkdb

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thinkdb

ThinkLab manager database MongoDB

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Installation

$ npm install thinkdb

Import

var DB = require("thinkdb");

Configure

DB.domain = "localhost";
DB.port = "27017";//27017 default
DB.projectname = "es6";//name collection

New Table

DB.newtable("myTableName", ["name", "age", "city"]);
DB.newtable("myOtherTableName", ["dog", "cat", "human"]);

Approval

var newdata = ["eliasruizh", 19, "México City"];
var approval = DB.approval("myTableName",newdata);
if(approval != false){
    (yes)
    ...
}
var approval2 = DB.approval("myOtherTableName",newdata);
if(approval2 != false){
    (not)
    ...
}

Save approval

if(approval != false){
    DB.insert(approval, function(result){
        console.log(result);
    },"myTableName");
}

Find & FindOne

DB.find({age:19},fucntion(documents){
	console.log(documents.length);
	if(documents.length > 0){
	    console.log(documents[0].name);//eliasruizh
	}
},"myTableName");

DB.findOne({age:19},fucntion(document){
	console.log(document.name);//eliasruizh
},"myTableName");

Update

DB.update({age:19},{name:"@eliasruizhz"},fucntion(result){
	console.log(result);
},"myTableName");

Remove

DB.remove({name:"@eliasruizhz"},fucntion(result){
	console.log(result);//true:1
},"myTableName");

DB.remove({},fucntion(result){
	console.log(result);//false:0
},"myTableName");

License

ISC - http://www.think-lab.com.mx/

Keywords

ThinkLab

FAQs

Package last updated on 29 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts