Skip to content

Commit

Permalink
add console for querying
Browse files Browse the repository at this point in the history
  • Loading branch information
jessmitch42 committed Sep 6, 2023
1 parent 70bc433 commit 3ee9960
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async function addNotionPageToDatabase(databaseId, pageProperties) {
}

async function queryDatabase(databaseId) {
console.log("Querying database...")
// This query will filter database entries and return pages that have a "Last ordered" property that is more recent than 2022-12-31. Use multiple filters with the AND/OR options: https://developers.notion.com/reference/post-database-query-filter.
const lastOrderedIn2023 = await notion.databases.query({
database_id: databaseId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ async function addNotionPageToDatabase(databaseId, pageProperties) {
}

async function queryAndSortDatabase(databaseId) {
console.log("Querying database...")
// This query will filter and sort database entries. The returned pages will have a "Last ordered" property that is more recent than 2022-12-31. Any database property can be filtered or sorted. Pass multiple sort objects to the "sorts" array to apply more than one sorting rule.
const lastOrderedIn2023Alphabetical = await notion.databases.query({
database_id: databaseId,
Expand Down

0 comments on commit 3ee9960

Please sign in to comment.