initializeUnorderedBulkOp() returns different results for normal and system user

Hi team,

I want to make an insertMany from a react app and get ALL the errors from duplicated values (by id) in response.

I created a custom function using initializeUnorderedBulkOp(), and I used the console to check the response. THE PROBLEM IS that I get a different result if I use a normal user (only first duplication error) and a different one if I use the system user (all the duplications).
From my app, I get the same response as a normal user. The one with only the first duplicate

Does anyone have any idea how should I move on with it?
Thank you in advance

Figured it out.
It seems that the system and a normal user handle differently the response from initializeUnorderedBulkOp().

The only thing that was required, was to set my Custom Function to run as a System User.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.