简体   繁体   中英

How to save a document with a file mongodb

I want to save a document(a person's information) in mongodb, with a pdf File uploaded and added in it(CV) which means each document is related with a file. There is GridFS, i found that files are stored in two specific collections: files and chunk.

Is there any method to save document with reference file in it, or a way to map relationships between documents and stored files ?

Thank you.

i resolved this problem: i uploaded a MultipartFile, transfered it to a directory and then linked its objectId to a document, please check my answer in this link

Could not Upload File using MongoDb GridFs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM