Under the Model documentation (https://dynamoosejs.com/guide/Model) there is an example where the Document class is extended to achieve type checking.
The example from the docs
// Strongly typed model
class Cat extends Document {
id: number;
name: string;
}
const CatModel = dynamoose.model<Cat>("Cat", {"id": Number, "name": String});
This looks like a neat feature, but how do one get a hold of the Document class/type referred to in this example. I can't find anywhere on the dynamoose import where it's exposed?
Thank you.
@hardyscc Any insight here?
@jornki just import it like that
import { Document } from 'dynamoose/dist/Document';
This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 3 days.
Most helpful comment
@jornki just import it like that