MongoDB interview question

Rewrite a section of code