Skip to content

NotionTable findMany Argument not match as documentation #3

@0length

Description

@0length

The implementation of the findMany method uses mismatched properties from the options argument.

Documentation URL
https://interactive-inc.github.io/open-notion/guides/query.html#find-many

// Get all records
const { records } = await contactsTable.findMany()

// With filtering
const { records } = await contactsTable.findMany({
  where: { active: true }
})

// With pagination
const { records, hasMore, nextCursor } = await contactsTable.findMany({
  limit: 10
})

// Next page
const nextPage = await contactsTable.findMany({
  limit: 10,
  cursor: nextCursor
})

Library method declaration
https://github.com/interactive-inc/open-notion/blob/a147f05a54499933a83010d41cf3ffd39a1e879d/lib/table/notion-table.ts#L57-L81

The documentation and intended usage show that the options object should contain the limit and cursor properties for pagination. However, these properties are not utilized within the function body, which prevents pagination from working as wanted. The function body incorrectly attempts to use a count property from the options object instead.

BTW i just reporting this library problem, and i have no solution to merge for now.

Thank you for making this library. I still happy to use it. @shigurenimo @sakaritoru Arigato

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions