GridFS Node.JS Native Driver - How to get ignore ContentType?

80 Views Asked by At

I'm interacting with MongoDB with several drivers including PyMongo and Node.js Native MongoDB driver.
What I noticed is that when I do fs.put for GridFS storage from PyMongo it only sets few fields including UploadDate, but when I do fs.put for GridFS storage from Node.JS it also inserts additional fields to storage that I don't need including ContentType.

That may be good practice, but I dont want this field, how do I configure MongoDB insert to ignore insertion of this field when adding file to GridFS from Node.JS? According to docs you can either set it or it will use default ContentType (content_type).

How to not insert this field it all?

1

There are 1 best solutions below

0
On BEST ANSWER

Well, seems like there's no support for this feature. So I just commented stuff for fields contentType and aliases in MongoDB Driver library for Node.JS. Its bad practice, but unfortunately there's no another option for that right now.