O
O
olezhenka2018-08-22 20:11:23
MongoDB
olezhenka, 2018-08-22 20:11:23

Is it normal to use discriminators on a huge collection?

I will store a million posts from social networks in one collection. I find it convenient to use discriminators. But I think it will not be effective when searching for posts, because all the documents will be in one collection and the database will have to go through all the documents. Is it better to share collections across social networks or use discriminators?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lega, 2018-08-22
@lega

Use indexes, then you can quickly find the posts you need without going through the entire database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question