I am new to node.js, so I have a feeling that this will be something silly that I have overlooked, but I haven\'t been able to find an answer that fixes my problem. What I\'
Had the same problem, I just coerced the id into a string.
My schema:
const product = new mongooseClient.Schema({ retailerID: { type: mongoose.SchemaTypes.ObjectId, required: true, index: true } });
And then, when inserting:
retailerID: `${retailer._id}`