In my system users can create their own fields and call it as they wish. The only restriction is using _ at the beginning because that’s how we represent the id of the data. Since every output trigger needs an id, I was just converting the _id to the id field, but this creates a conflict when a user has an id in their data. Like this:
My questions is if there is a good solution for solving this problem.
I was thinking about not using the _id for the output id but I wouldn’t use what to use instead.
Best answer by Diego OrcaView original
Might not be the best solution but the simplest might be just to preserve the ‘id’ field to a new key prior to overwriting it with the ‘_id’ field?
I fixed the issue encapsulating the data into an object like this: