Socket
Socket
Sign inDemoInstall

node-ebaas

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ebaas

ele baas node sdk


Version published
Weekly downloads
4
decreased by-69.23%
Maintainers
3
Weekly downloads
 
Created
Source

node-ebaas

ele baas node sdk

install

npm install node-ebaas

use

const Baas = require('node-ebaas');

const APPID = '59192c5984a2fc6c74675dbd';
const TABLE = 'docs';

const DocModel = new Baas(APPID, TABLE);

let docs = await DocModel.find();

init


new Baas(APPID, TABLE, config);

config[optional]
  • env(string) alpha/alta/altb/production (default: production)

  • secue(boolean) https 或者 http (default: true)

  • debug(boolean) (default: false)

  • host(string) custom host, example: baas.ele.me (default: null)

method

所有函数最后一个参数可以传递 headers

find(query) -> find(query, headers)

使用例子:

const AppModel = new Baas(APPID, TABLE, config);

const headers = {
  Cookie: 'COFFEE_TOKEN=[YOU_COFFEE_TOKEN]'
};

await AppModel.find(null, headers);

注意,这里因为 find 的第一个参数是 queryObject,所以为了保证 headers 是在最后一个参数,第一个参数不能省略

Model

find(query)

查询

count(query)

计数

findById(_id)

根据 _id 查询

create(body)

创建

update(_id, body)

更新

remove(_id)

删除

Instance

save()

更新保存

update(body)

更新保存

detroy()

删除

inc(key, value)

增减操作,save() 后生效

FAQs

Package last updated on 08 Jan 2018

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