Closed olhapi closed 6 years ago
Did you set the _idClass
property with your constructor?
Docs: https://github.com/jedireza/mongo-models/blob/master/API.md#_idclass
Example using String
instead of MongoDB.ObjectID
:
https://github.com/jedireza/frame/blob/b59761b1ea73a4eac257a676c06b4909547c99db/server/models/status.js#L33
I always get
Argument passed in must be a single String of 12 bytes or a string of 24 hex characters
error when trying to use *byId methods of mongo-models with custom IDs (for example: D1, D4).