tengine:api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
tengine:api [2022/06/09 01:15] twinnytengine:api [2022/06/09 01:21] – [DescribeTable] twinny
Line 122: Line 122:
  
 Conditions include Conditions include
-begins_with - the sort key begins with the provided string +  * begins_with - the sort key begins with the provided string 
-* > - the sort key is greater than the provided value (Note: compared as a string) +  * > - the sort key is greater than the provided value (Note: compared as a string) 
-* < - the sort key is less than the provided value (Note: compared as a string)+  * < - the sort key is less than the provided value (Note: compared as a string) 
  
 Consider this table with the following items: Consider this table with the following items:
 +<code>
 ... ...
 {pk: "item1", sk: "sort_19"} {pk: "item1", sk: "sort_19"}
Line 135: Line 137:
 {pk: "item1", sk: "sort_24"} {pk: "item1", sk: "sort_24"}
 ... ...
 +</code>
  
 Example queries: Example queries:
 +  * pk == item1 : will return all 6 items 
 +  * pk == item1 and sk == "sort_20" : will return the single matching item
  
-pk == item1 : will return all 6 items  +  * pk == item1 and sk begins_with "sort_2" : will return the 5 items where sk starts with sort_2 
-pk == item1 and sk == "sort_20" : will return the single matching item +  pk == item1 and sk > sort_23 : will return just sort_24 since it's the only item > 23
- +
-pk == item1 and sk begins_with "sort_2" : will return the 5 items where sk starts with sort_2 +
-pk == item1 and sk > sort_23 : will return just sort_24 since it's the only item > 23+
  
 === Argument Format === === Argument Format ===
Line 151: Line 153:
     "string"=STRING     "string"=STRING
   }   }
 +  sortorder="ASC"/"DESC" - set the sort order to be returned. ASC by default. Note this is sorted by string value: not numeric
 +  startat=INTEGER - if set, skips the number of items configured here before potentially read and returning items. Useful for pagination
 +  limit=INTEGER - if set, limits the number of read/returned items. Useful for pagination
 +  conditions=ARRAY of ARRAYS e.g. {  {"begins_with", "sort_"}, {">", "sort_5"}, {"<", "sort_15"} }
 } }
 +</code>
 +
 +=== Return Format ===
 +<code javascript>
 +{
 +  result=[KEYS,DATA]
 +  success=BOOLEAN
 +  readcount=INTEGER  - how many items were read and returned (after limit, startat, conditions)
 +  foundcount=INTEGER - how many items were intiially found
 +  error=STRING
 +}
 +</code>
 +
 +=== Example Request ===
 +<code javascript>
 +tbd
 +</code>
 +
 +=== Example Return ===
 +<code javascript>
 +tbd
 </code> </code>
  
Line 255: Line 282:
 } }
 </code> </code>
 +
 +==== ListTables ====
 +
 +tbd
 +
 +==== DescribeTable ====
 +
 +tbd
 +
 +----
  
 ~~DISCUSSION~~ ~~DISCUSSION~~
  • tengine/api.txt
  • Last modified: 2023/04/23 06:35
  • by twinny