Constructor
(package) new TableRecord(tableName, recordID, queryObjectopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tableName |
string | 数据表名 | |
recordID |
string | 数据记录 ID | |
queryObject |
object |
<optional> |
查询对象 |
- Source:
Extends
Methods
append(key, value) → {this}
数组添加元素。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
string | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
incrementBy(key, value) → {this}
自增(原子操作)。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
number | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
patchObject(key, value) → {this}
Object 类型字段修改。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
object | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
pop(key) → {this}
Array 类型字段修改,移除数组末位元素。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
- Overrides:
- Source:
Returns:
- Type
- this
remove(key, value) → {this}
数组移除元素。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
string | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
save() → {Promise.<BaaS.Response.<any>>}
保存数据记录。
- Source:
Returns:
- Type
- Promise.<BaaS.Response.<any>>
set(particialRecord) → {this}
批量给字段赋值
Parameters:
Name | Type | Description |
---|---|---|
particialRecord |
Object.<string, any> | 由字段名称与值组成的键值对对象 |
- Overrides:
- Source:
Returns:
- Type
- this
shift(key) → {this}
Array 类型字段修改,移除数组首位元素。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
- Overrides:
- Source:
Returns:
- Type
- this
uAppend(key, value) → {this}
数组添加元素(原子操作)。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
Array.<string> | string | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
unset(key) → {this}
移除字段
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
- Overrides:
- Source:
Returns:
- Type
- this
unset(particialRecord) → {this}
批量移除字段
Parameters:
Name | Type | Description |
---|---|---|
particialRecord |
Object.<string, any> | 由字段名称与值组成的键值对对象, 接口会忽略 Object 里所有的 value,参照所有的 key 来执行移除操作。 |
- Overrides:
- Source:
Returns:
- Type
- this
update(optionsopt) → {Promise.<BaaS.Response.<any>>}
更新数据记录。
批量更新时,如果不需要触发触发器,可以设置 options.enableTrigger 为 false
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
BaaS.BatchUpdateParams |
<optional> |
批量更新参数 |
- Source:
Returns:
- Type
- Promise.<BaaS.Response.<any>>
set(key, value) → {this}
给字段赋值
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
string | 值 |
- Overrides:
- Source:
Returns:
- Type
- this