M
M
MasterEditor2018-04-06 08:02:08
MongoDB
MasterEditor, 2018-04-06 08:02:08

How to add large text to Mongo base?

Hi, let's say I want to make an article model. I will add title: String, url: String there, but what to do with the text from the article itself? String can't store that much text, and I couldn't find anything else. The idea of ​​keeping everything in a separate file seems absurd. How to proceed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RidgeA, 2018-04-06
@MasterEditor

Hmm, is the article longer than 2^32 bytes?

F
forspamonly2, 2018-04-06
@forspamonly2

if the architecture allows, you can store the json in gzip-compressed form and give it to the client without unpacking it. the most optimal option of all - saves both disk I / O, and network, and cache space.
if it doesn’t allow, and still doesn’t fit, then you can push it into mongofs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question