Storing file and query its content in MongoDB

Hi, i am new to MongoDB and NoSQL.
I am trying to store log files from my apps and will need to query the log content using keywords. The log file size is < 5mbs.

In a traditional relational databases, i can extract the log file and store it into a table with the columns i.e. [AppName], [DateTime], [Content].

Recently i am exploring an ideal to storing file into NoSQL. I would like to know how mongoDB can work out in my case. If so, what is the advantage using MongoDB compare to the traditional relational databases.

Appreciate any help or suggestions. Thanks!

Often it is a better design pattern with large objects to store them in the file system and store references to their location in the database. Every language nowadays has regular expressions so your program can wander through them.

But if you want to store large objects in your database, MongoDB itself has regex searches.

As far as the size, the maximum BSON document size is 16 megabytes.

1 Like