mongoose-sequence icon indicating copy to clipboard operation
mongoose-sequence copied to clipboard

Auto-increment has been done in case of document conflict

Open OhDavit opened this issue 6 years ago • 4 comments

I have a collection with lets say X auto increment field and which has also compound unique index. So in case of duplication of fields save method returns 409 error, but X field has been incremented. The expected behavior would be to increment X field only when document is saved in the collection.

OhDavit avatar Feb 22 '18 13:02 OhDavit

I think you're right. I have to remember why I chose to use the 'pre' middleware. I'll be back to this, soon

ramiel avatar Feb 23 '18 08:02 ramiel

@ramiel any updates to solve this issue?

Leeiio avatar Jan 23 '19 17:01 Leeiio

Same issue

wilav-dev avatar Jan 06 '22 15:01 wilav-dev

Not really. Can you provide a little reproduction repo?

ramiel avatar Jan 07 '22 11:01 ramiel