Introduction
We will learn how to implement a RESTful API for a simple todo application using NestJS framework. But what is NestJS?
"A...
For further actions, you may consider blocking this person and/or reporting abuse
Excellent post!
I've been hacking NodeJS, MongoDB, Mongoose for last month working on REST API for client-side Blazor app. I've been wanting to learn TypeScript and came across this post via a look into Nest.
Since I'm new to TypeScript, I'll definitely checkout the links at the top to gain a deeper understanding of the code presented here.
Any thoughts on where to head next to gain a broader understanding of Nest?
Hey thanks for reading and glad you enjoyed it!
That's good to know, hope you'll enjoy writing more of TypeScript. I can suggest you to take a look at how validation rules is being implemented in Nest by creating Pipes, middleware, all related to security.
Then I think you can take a look at how you can implement web sockets with Nest, which is also something I want to explore/learn more about it.
Ang galing nito Miguel, thanks for writing the article.
How do I force the schema to use a collection name?
OK na Miguel, I figured it out.
@Schema({ collection: 'collection name' })
Mongoose will pluralize the collection name from the schema name unless explicitly declared like this.
Sounds good! Thanks Ian 🎉
thanks i also have same doubt but you cleared now
Thank you po Ian! Happy that you enjoyed reading it!
Anyone has a complete starter with mongoose?
Too simple this article, _id must be id, also population needed… module in module.
Entities? No one is using them? Also about the mapping? And creating custom fileds (like name + surname)
Greats!
Thanks man!
How did you connected to MongoDB without any credentials?
I didn't setup a password when I installed MongoDB in Ubuntu.
Good one!
Thanks!
Is possible to have all the validations only in one place (the schema), and reuse the schema to create the dto?
This tutorial is what I want exactly, thanks for sharing!
hi buddy, when we are using: async function(....) { return await ..... },
should we add Promise or not? (like below):
async func(....): Promise {
return await ......
}
Hey, yea it's good too if you explicitly define the return type of the function. You can pass down a generic type argument to
Promise
as well so you don't accidentally return a different type of data and that might cause bugs to your code.i love this write. it will be a next power if you had added the auth module in it.
Hey, thanks! That's a good idea, I'll create an Auth implementation hopefully soon. Just got a lot of things going on my end.
Thank you so much for your valuable content :)
Thanks for post <3