Placing items of different type in same collection a separate collection

Hei there,
First let me say Merry Christmas dears :christmas_tree:
I am having this important question regarding best practice for search and indexing.
In our local market app we have daily-life-items and vehicles. Should we put all items and vehicles in same collection? or separat collection for each type? is it possible to run a global search in both collections at the same time? Can you please enlighten us what is the best practice to get optimal performing result, great for both frond end search experience and backend/database as well as cheapest to run.
Hope question is clear. Thanks in advance
Kind regards,
Behzad :slight_smile:

Hi @Behzad_Pashaie,
I’m not an expert in schema design, but I can suggest that you go read some more info to see how you can best model your documents, so that you can know what the best decision is to make.
Building with Patterns: A Summary | MongoDB
I hope this link can be useful for you.

Regards and Merry Christmas :christmas_tree:

Thanks @Fabio_Ramohitaj ,
I will check it . Hope i can find my answer there :slight_smile:

Kind regards,
Behzad

Read Single Collection Database Design - #2 by Asya_Kamsky.

If your documents represent completely different concept, like daily-life-items and vehicles seem to indicate, I would keep them in different collection. If they participate in different use-cases, (except global search) I would keep them separated. You can control security access at the collection level but you cannot at the document level. That’s one of the major advantages to have more than one collection.

Hei @steevej ,
Thanks for the answer and confirming we are on right path. :pray: :ok_hand:
Wish you a merry Christmas and new year :slight_smile:

I wish you the same and peace too.