Confirming a data structure for my first mongodb project

Hey, I’m relatively new to MongoDB and have been wanting to use it for a website. I was wondering about the best way to structure my data for the same…I plan to make this a serverless application using realm and functions…

The basic concept is there’s gonna be 1 single database containing 1 collection… The documents of that collection are going to be visible on the main page, sorta like tweets on Twitter, and more can be added by users. However, before actually appearing on the main page, they need to be approved by an admin.

My approach was to insert the document in the main collection with a field:
verified:false
then, I could just render only the documents that have
verified:true
on the main page and only those with
verified:false
on the approval page visible only to admins, along with a button to update this property to true…

I just wanted to know whether or not there’s a better approach to achieve the same result…

P.S: Sorry for the long message, and thanks in advance…

Personnaly, I will probably have 2 collections:

  1. main collection with with only verified documents
  2. secondary collection with unverified documents

Main advantages are

  • the field verified is not needed in the main collection thus saving space
  • the indexes of the main collections are updated only when posts are verified saving some processing when documents are rejected
  • might be able to play with privileges with 2 users viewers and admin so that viewers never sees unverified documents even if they can get the viewers credentials