table
Table Object
multi index table object
Member Attribute
name
table name
Type:String
Example:
1 | exports.hi = v => { |
code
Point to the name of the contract issuer
Type: String
Example:
1 | exports.hi = v => { |
scope
account_name belongs to the data of table
Type: String
1 | exports.hi = v => { |
indexes
Query the current index,return all index object,Each index is a new Table object
Type: Object
1 | exports.hi = v => { |
member function
emplace
save new data to table
1 | Table.emplace(payer,val); |
Parameter Usage:
- payer: String, the account pays for this operation
- val: Object, the value will save in table
Example:
1 | exports.hi = v => { |
find
find data from table
1 | Table.find(id); |
Parameter Usage:
- id: Value, Query parameters
Results:
- DBIterator,return a database iterator
Example:
1 | exports.hi = v => { |
get_primary_key
Generate an autoincrement primary key
1 | Table.get_primary_key(); |
Example:
1 | exports.hi = v => { |
lowerbound
Find the result less than parameter from the table
1 | Table.lowerbound(id); |
Parameter Usage:
- id: Value, Query parameters
Results:
- DBIterator,return a database iterator
Example:
1 | exports.hi1 = v => { |
upperbound
find results that greater than parameter from table
1 | Table.upperbound(id); |
Parameter Usage:
- id: Value, Query parameters
Results:
- DBIterator,return a database iterator
Example:
1 | exports.hi1 = v => { |
toString
Return a string representation of an object,General return “[Native Object]”,Objects can be reimplemented according to their own characteristics
1 | Table.toString(); |
Results:
- String, string of returning object
Example:
1 | exports.hi1 = v => { |
toJSON
JSON format of returning object,Returns a collection of readable properties defined by an object
1 | Table.toJSON(key); |
Parameter Usage:
- key: String, Not used
Results:
- Value, return the value that can be json serialized
Example:
1 | exports.hi1 = key => { |