Adding `_id` to inferred types
I'm happilly using the Infer type which I love. but it doesn't include an id field (as it might not have one) is there a recommended way to add an id property to an infer'ed type
2 Replies
Yay, glad you like it!
Yup, it doesn't add
_id
because the type might not be an entire document (it could be just a piece of one).
I think the best way to add the _id
field is with:
Also obviously if the type is an entire document, it's easier to just use the Document<TableName>
type.(not obviously!) thank you