Skip to main content

Sort results

Sort results in the JSON DB


sort results in the JSON DB

Most actions can return results in some of the following orders:

  • Index order

    The get records actions that use an index return results in index order, which is always sorted by index key.

  • Table order

    The get records actions that use a table return results in table order, which is always the order of record position in the table. Typically records are inserted at the end of the table; thus, table record order is normally in the order that records are inserted. There is an exception. FairCom DB reuses deleted space and this may cause a newly inserted record or an updated record to be inserted in the space of a previously deleted record.

  • SQL order

    The "getRecordsUsingSQL" action returns results in sorted order based on SQL’s ORDER BY clause.

Many actions provide the "reverseOrder" property to reverse the sort order of the results. This property does not apply to cursors because a cursor can walk the results forward or backward.