#TypeScript Error on `id` Field in Payload Query

3 messages · Page 1 of 1 (latest)

visual bladeBOT
#

Does anyone know why I am getting this on id field? I checked the database and types and both posts and comments do have id column....

 payload.find({
  collection: contentCollection,
  select: {
    id: true, <--- ON THIS LINE
    stats: true,
  },
  where: { id: { equals: contentId } },
}),
Object literal may only specify known properties, and 'id' does not exist in type 'SelectFromCollectionSlug<"posts" | "comments">'.ts(2353)
find.d.ts(85, 5): The expected type comes from property 'select' which is declared here on type 'Options<"posts" | "comments", SelectFromCollectionSlug<"posts" | "comments">>'
split forumBOT
#

Original message from @bold relic - Moved from #general message

#