'Best way to organise NoSql db for tags

I'm fairly new to webdev and I'm creating a platform where you can search for medias through tags. I'm using Mogondb an was wondering if I should rather:

  1. Store the tags with each objects

  2. Create a relation between tag objects and media objects. For example I have my "video" tag that contains a reference to all my videos.

Which is the cleanest and most efficient way ? Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source