1.1.1 • Published 1 year ago

@serverless-cd/ots-orm v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

OTS-ORM

详细使用文档请前往

使用

const Orm = require('@serverless-cd/ots-orm');

const orm = new Orm({
  accessKeyId: '',
  accessKeySecret: '',
  region: '',
  instanceName: '',
}, 'tableName', 'tableIndex');

// 查询单个TASK数据
async function findOne(primary1, primary2) {
  return orm.findByPrimary([{ userId }, { primary2 }]);
}
// 创建
async function create(primary1, primary2, params) {
  return orm.create([{ userId }, { primary2 }}], params);
}
// 查询列表
async function find(params = {}) {
  return await orm.find(params);
}
// 修改
async function update(primary1, primary2, params) {
  return orm.update([{ userId }, { primary2 }}], params);
}
// 删除
async function remove(primary1, primary2) {
  return orm.delete([{ userId }, { primary2 }]);
}

module.exports = {
  findOne,
  create,
  find,
  update,
  remove,
};
1.1.1

1 year ago

1.1.1-beta-1

1 year ago

1.1.0

1 year ago

1.0.9

2 years ago

1.0.7

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago