How to create fully typed model?
See original GitHub issueSummary:
Currently, when creating a new model the model type is simply Document. I believed the same approach can be taken as with mongoose and just supply interface when creating new model.
export default mongoose.model<IUser>('User', UserSchema);
But with dynamoose doing so will result in an error:
Type ‘Stat’ does not satisfy the constraint ‘Document’.
With mongoose, it is easy to simply have your interface extend mongoose’s Document interface, however, I can’t seem to find a way to access Document interface in dynamoose as it seems to not be exported.
What is the recommended route to create fully typed Models?
Other:
- I have read through the Dynamoose documentation before posting this issue
- I have searched through the GitHub issues (including closed issues) and pull requests to ensure this question has not already been raised before
- I have searched the internet and Stack Overflow to ensure this question hasn’t been raised or answered before
- I have filled out all fields above
- I am running the latest version of Dynamoose
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (4 by maintainers)
Top Results From Across the Web
A Comprehensive Guide to Build your own Language Model ...
Text Summarization, generating completely new pieces of text, ... We can build a language model in a few lines of code using the...
Read more >How To Create Custom Types in TypeScript - DigitalOcean
In TypeScript, the syntax for creating custom types is to use the type ... You can use intersection types to create a completely...
Read more >Strongly Typed Model Views | ASP.NET MVC Tutorial - YouTube
Chapters. View all · Introduction · Introduction · Introduction · Create New Project · Create New Project · Create New Project · Create...
Read more >Creating model classes in TypeScript - Stack Overflow
Types can be combined and should be used more for non-composite properties. ... Step 1: Create your model using “Classes”.
Read more >Making Our Own Types and Typeclasses - Learn You a Haskell
By using record syntax to create this data type, Haskell automatically made ... We want to keep track of the company that made...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@fishcharlie I will give it a try.
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.