New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ecdb

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ecdb

Make DB operation Easy

  • 0.2.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

ecDB

Build Status Deps Status

Make DB operation Easy

Install

https://www.npmjs.com/package/ecdb

npm install ecdb

Use

var ECDB = require('ecdb');
var ecDB = new ECDB();
ecDB.connect();

Use MongoDB

var ECDB = require('ecdb');
var ecDB = new ECDB({"driver": "EasyMongo"});
ecDB.connect({"url": "mongodb://127.0.0.1"});

Insert Data

ecDB would auto create the table and schema with your data

  • insert single row
ecDB.postData(
  'users',
  {name: 'WEI', birth: '1982-04-01', age: 33},
  function(error, result) {console.log(result);}
);
  • insert multiple rows
ecDB.postData(
  'users',
  [
    {name: 'WEI', birth: '1982-04-01', age: 33},
    {name: 'Becca', birth: '1985-07-18', age: 30},
    {name: 'Gary', birth: '1989-12-11', age: 26}
  ],
  function(error, result) {console.log(result);}
);

List All Tables

ecDB.listTable(function(error, result) {console.log(result);});

Get Table Schema

ecDB.getTable('users', function(error, result) {console.log(result);});

List Data in Table

  • List all data
ecDB.listData('TableName', function(error, result) {console.log(result);});
  • You can also use search query
ecDB.listData(
  'users',
  'where birth > "1988-01-01"',
  function(error, result) {console.log(result);}
);

Search JSON data

ecDB.dataFind(
  [
    {path: '/aaa/bbb/ccc/'},
    {path:'/aaa/bbb'},
    {path:'/aaa/bbb/qqq/'}
  ],
  'where path like "*/bbb/*"',
  function(error, result) {
    console.log(result);
  }
);

Keywords

FAQs

Package last updated on 18 Dec 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc