Pergunta de entrevista da empresa Infosys

How would you handle this situation in MongoDB?