I have collections Products and ProductImages(upload). I use mongodb.
I create folder "Top Products" and put products inside.
When fetch it I get only Id of the product and id of the image. Nothing populated.
I tried with local api, rest api, maxDepth in product.image field.
More details:
When call http://localhost:3000/api/payload-folders/683071b15448c6a4c61c8b36?depth=10&draft=false&locale=bg
or
const topProductsFolder = await cms
.find({
collection: 'payload-folders',
limit: 1,
where: {
name: {
equals: 'Top Products',
},
},
depth: 40,
})
.then((_) => _.docs[0])
I get this response
{
"createdAt": "2025-05-23T13:01:37.751Z",
"updatedAt": "2025-05-23T13:01:37.751Z",
"name": "Top Products",
"folder": null,
"documentsAndFolders": {
"docs": [
{
"_id": "682e209a639d73e49e2040a7",
"createdAt": "2025-05-21T18:51:06.266Z",
"relationTo": "products",
"value": {
// no product data - title, price and etc
"image": "682e1fdc639d73e49e203f54",
"id": "682e209a639d73e49e2040a7"// no image data
}
},
{
"_id": "682cb53c1cd12ece8e854467",
"createdAt": "2025-05-20T17:00:44.827Z",
"relationTo": "products",
"value": {
// no product data - title, price and etc
"image": "682e0419c922b137696c3ded", // no image data
"id": "682cb53c1cd12ece8e854467"
}
}
],
"hasNextPage": false
},
"id": "683071b15448c6a4c61c8b36"
}