MongoBulkWriteError: E11000 duplicate key error collection
MongoBulkWriteError: E11000 duplicate key error collection: ..._alclient.entities index: serverRegion_1_serverIdentifier_1_name_1_type_1 dup key: { serverRegion: "US", serverIdentifier: "III", name: null, type: "mrpumpkin" }
This happens to mrpumpkin & mrgreen, in both cases the key part name is null.
So it's obviously this index that raises the issue:
EntitySchema.index({ name: 1, serverIdentifier: 1, serverRegion: 1, type: 1 }, { unique: true })
Looks like there only is one place where the date is inserted:
https://github.com/earthiverse/ALClient/blob/f9ea72cec856ff7b0dc2704d7db60a297be87f91/source/Observer.ts#L162,L170
if (Database.connection) {
EntityModel.updateOne({
serverIdentifier: this.serverData.name,
serverRegion: this.serverData.region,
type: data.name
}, monsterData, {
upsert: true
}).lean().exec().catch((e) => { console.error(e) })
}
Since name isn't even used I would suggest to remove it from the index. Not sure though whether this will fix the issue.
Same happened for snowman.