Modify the content_type of the girdfs file in batches
:
db.fs.files.update({"filename": /.*\.pdf/ },{ $set : { "contentType" : "application/pdf" } },false,true); db.fs.files.update({"filename": /.*\.png/ },{ $set : { "contentType" : "image/png" } },false,true);
Query: bd.fs.files.find(filename:”uploads/payment_info/path/00/09/62/ebbc0565-5abd-4e8c-857c-480cd34fc35e.pdf”)
Delete: db.fs.files.remove({filename :/^uploads\/pament_info\/path/});
Tutorial:
http://www.ziqiangxuetang.com/mongodb/mongodb-update.html
http://www.ziqiangxuetang.com/mongodb/mongodb-atomic-operations .html