Skip to content

sort

const sort: object

Defined in: src/helpers/sort.helpers.ts:68

Chainable sort builders for Notion database queries.

createdTime: () => TimestampSortBuilder

Sort by creation time.

TimestampSortBuilder

sort.createdTime().descending()

lastEditedTime: () => TimestampSortBuilder

Sort by last edited time.

TimestampSortBuilder

sort.lastEditedTime().ascending()

property: (name) => PropertySortBuilder

Sort by a database property.

string

PropertySortBuilder

sort.property('Name').ascending()
sort.property('Due Date').descending()
import { sort } from '@visus-io/notion-sdk-ts';
notion.databases.query('db-id', {
sorts: [
sort.property('Priority').ascending(),
sort.createdTime().descending(),
],
});