Closed
Description
Hi,
I have this model:
_id: mongoose.Types.ObjectId,
name: { type: String, required: true },
mimetype: String,
content: Buffer,
I return content
field with this code in Nest js framework:
res.contentType(f.mimetype);
res.send(f.content);
When I find document with this code:
this.files.findById(imageId);
It's OK.
but when I use .lean() function in findById Or findOne and return image to client, Image is not valid image file!
I use:
MongoDb cloud v 4.0.
mongoose: ^5.5.7
@nestjs/mongoose: ^6.1.2,
thanks.