hello I'm working with mongoose and after a long time I still dont know how to fix this error... I tried during several hours to fix it but every time I just 'hide' the problem by complete the field with random character but for my project I cant, I need a precise Id so if someone could help with an example if he can, it will be really nice
Error: Argument passed in must be a single String of 12 bytes or a string of 24 hex characters
I m trying to create an Id like : map1AssigneSeat
And to persist I use this code where mapId is equal to map1AssigneSeat:
var rowData = new MapDatabase({
MapDescription: mongoose.Types.ObjectId(mapId),
DeckNumber: Number(map.Deck[i].DeckNumber),
x: Number(map.Deck[i].x),
y: Number(map.Deck[i].y),
});