Armrest Node.js 客户端库
用于创建 Armrest 客户端的节点.js 库 .
安装
使用 npm 安装
npm install @armrest/client
开始
无害环境管理
import Armrest from '@armrest/client'
创建新 api
const API = new Armrest('http://armrest-api-url')
.model('Example')
const api = API.Session('api-key')
创建对象
const example = await api.Example.create({
test: 'attribute'
})
更新对象
await example.update({ test: 'changevalue' })
选择对象
对象可以使用任意属性选择.
const results = await api.select(api.Example).filterBy({ test: 'value' })
使用 filter。 。 。 .
const results = api.Example.filter(
pl.or(
pl.Example.test.eq('value'),
pl.Example.test.eq('othervalue')
)
)