MongoDB how to prevent prevent duplicate row?


Hi all,

I already have check duplicate with first in beforeSave but if I test via Promise.all call to cloud function

It’s not work.

Have any solutions for me?

Thank you so much.


Ideally you can add a unique index to the mongo collection. If you do that, then will fail.

1 Like

Yeah, final solution for me right now.