698 viewsNext Amazona

Hello Basir 👋
When defining the schema for the product in models/product, I get an error for the image. Mongodb won’t allow me to give it a type of string.
Now when I use an image url and set the type to string, it seeds successfully but when I upload the image from utils/images, it doesn’t seed successfully. I’d be very delighted to hear your thoughts on that and how such a problem can be solved.

Bassir Answered question October 13, 2022

hello there,

how do you upload from  utils/images?

share the code and use consol.log to see what you pass as value to image field in product model. is it string or something else?

Bassir Answered question October 13, 2022
You are viewing 1 out of 1 answers, click here to view all answers.