UUID type for mongo id #661
Unanswered
waynehaffenden
asked this question in
Q&A
Replies: 1 comment 4 replies
-
next time, please directly use github discussions if you mean class Test {
@prop({ type: () => String, required: true })
public _id!: string;
}
// Because you are re-defining the "_id" property, you cannot use ObjectId's anymore (or anything that requires it), also, as long as option "default" is not set, you have to provide the "_id" property every time you create a document |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking at using UUID v4 as the IDs for all the collections/models in Mongo, any ideas on how I do this?
Beta Was this translation helpful? Give feedback.
All reactions