Schema-based slug plugin for Mongoose - single/compound - unique over collection/group - nested docs/arrays - relative/abs paths - sync on change: create/save/update/updateOne/updateMany/findOneAndUpdate tracked - $set operator - counter/shortId
40
stars
13
forks
source link
Duplicate slug generated when subdocument added to existing document #25
Closed
mykwillis closed 3 years ago
I have a document that has an array of subdocuments. Each subdocument contains a permanent slug unique to the parent:
If I create an initial document with some children:
then everything is fine; both of the new subdocuments get properly generated and unique slugs.
However, if I update the document with another child subdocument:
then the new document receives a duplicate slug.