sort
constsort:object
Defined in: src/helpers/sort.helpers.ts:68
Chainable sort builders for Notion database queries.
Type Declaration
Section titled “Type Declaration”createdTime
Section titled “createdTime”createdTime: () =>
TimestampSortBuilder
Sort by creation time.
Returns
Section titled “Returns”TimestampSortBuilder
Example
Section titled “Example”sort.createdTime().descending()lastEditedTime
Section titled “lastEditedTime”lastEditedTime: () =>
TimestampSortBuilder
Sort by last edited time.
Returns
Section titled “Returns”TimestampSortBuilder
Example
Section titled “Example”sort.lastEditedTime().ascending()property
Section titled “property”property: (
name) =>PropertySortBuilder
Sort by a database property.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”PropertySortBuilder
Example
Section titled “Example”sort.property('Name').ascending()sort.property('Due Date').descending()Example
Section titled “Example”import { sort } from '@visus-io/notion-sdk-ts';
notion.databases.query('db-id', { sorts: [ sort.property('Priority').ascending(), sort.createdTime().descending(), ],});