#payload.find in custom field

2 messages · Page 1 of 1 (latest)

valid quest
#

Hi

I'm trying to use payload.find in a field I'm creating - I want to lookup other documents based on the input of the input field. I'm getting this error though when trying:
index.tsx:23 Uncaught (in promise) TypeError: payload__WEBPACK_IMPORTED_MODULE_3__.default.find is not a function

The code looks like this:

const result = await payload.find({
                collection: Category.slug,
                limit: 10,
                where: {
                    trackingId: {
                        contains: value
                    }
                }
            })
valid quest
#

ok looks like I need to use fetch against the local api