Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alipay/faas-db-builder

Package Overview
Dependencies
Maintainers
3
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alipay/faas-db-builder

db builder

  • 1.1.8-alpha.1
  • npm
  • Socket score

Version published
Weekly downloads
18
decreased by-79.55%
Maintainers
3
Weekly downloads
 
Created
Source

@alipay/faas-db-builder

db 调用参数解析器

用法示例

import { MongoBuilder } from '@alipay/faas-db-builder';

const db = new MongoBuilder();

// 获取查询 collection 列表的 mongo 请求参数
const res1 = db.listCollection(123, 456);

assert.deepStrictEqual(res, {
  // 查询列表操作
  action: 'queryList',
  // 参数详情
  options: {
    $limit: 123,
    $skip: 456,
  },
  // 操作对象为 collection
  target: 'collection',
});

// 获取在名为 'todo' 的 collection 中添加 document 的 mongo 请求参数
const res2 = db.collection('todo').add({
  data: {
    text: 'hello mongo',
    done: false,
  },
});

assert.deepStrictEqual(res2, {
  // 新建操作
  action: 'create',
  // 目标 collection 名
  collectionName: 'todo',
  // 参数详情
  options: {
    done: false,
    text: 'hello mongo',
  },
  // 操作对象为 document
  target: 'document',
});

FAQs

Package last updated on 29 Jun 2023

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