I am using payload cms for my blog created in next.js. I have a problem downloading the image URL that I upload to AWS S3 in a Rich Text field.
The MongoDb query returns an object that contains the
of the image from the
Currently, in the
component I created based on the docs on the frontend side sends a request to the api along with the id of the image, which returns me a
from the media table.
Is there a simpler way to do this, to retrieve the
immediately on the backend when querying to MongoDb?
You can use Payload's local API to get your data out and have relationships and uploads populated by the desired depth you need for your frontend. It sounds like you are maybe querying with mongo/mongoose directly and missing out on a big advantage of working with Payload.