Create ObjectId in mongoose using a seed string

I want to create an objectid in mongoose using a seed string eg-

Id = new ObjectId("alex"); 

Something on similar lines. But whatever examples I saw to generate the objectid require you to pass in the string in the objectid's hash format.

Is there a way to do what i want?

ObjectIds do not accept seeds. If you just want custom _ids for your documents you can declare them as Strings, Numbers, etc in your schema.

Schema({ _id: String })