#Folders: Depth has no effect, items in folder not populated

6 messages · Page 1 of 1 (latest)

azure patrol
#

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"
}
azure patrol
#

Folders: Depth has no effect, I got string instead of object

#

Folders: Depth has no effect, items in folder not populated

#

In plain new project based on sqlite I dont have this problem ...

opaque quail
#

same for me - i have a nested structure for a block with media as one of the fields. it always outputs only the id of the media

however if i run a surgical query on media collection it outputs everything correctly.

i tried increasing depth and clearing cache but it doesnt work.

i think the problem is that Payload really focuses on the MongoDB - template projects are all built with it, so there is no inherent underfetching problem.

omg i give up debugging it, no way i should change to GQL or manually run queries for specific collections in blocks