whenever I am using new mongoose.Types.ObjectId(id) object id gets depreciated and I am getting this – The signature ‘(inputId: number): ObjectId’ of ‘ObjectId’ is deprecated.ts(6387)
bson.d.ts(1247, 8): The declaration was marked as deprecated here.
(alias) new ObjectId(inputId: number): mongoose.mongo.BSON.ObjectId (+6 overloads)
import ObjectId
Create ObjectId from a number.
@param inputId — A number.
@deprecated — Instead, use static createFromTime() to set a numeric value for the new ObjectId.
tried everything without new, with bson, createFromTime(), createFromHexString() etc still not working please help
Kavish Ambani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.