I am in the need of to know is it possible to read the file content and store the contents as documents inside a collection in mongodb. If it s possible how to do that? If its not possible do there exist alternative way of doing that? Thanks in advance.
How to read file contents and store it in mongo db
2.9k views Asked by saipriya At
2
There are 2 answers
0
On
You can use MongoDB APIs for whatever programming language that you're familiar with.
Check out this: http://api.mongodb.com/
You can add files to GridFS within mongo by using
mongofiles.exe
from command line. (https://docs.mongodb.com/v3.0/reference/program/mongofiles/)We can put a file within the GridFS store by running the following command and arguments
We can then drop in to the mongo shell and see the file within the
fs.files
collection:MongoDB GridFS also allows you to add extra meta data on the file document and allows extra indexes too to allow you to easily search for documents.