Same feeling, the title is "Simple example Api Rest " but the implementation feels pretty complex and repetitive; and the nest documentation is not so clear either.
Is this the Nest way to use mongoose ? Is there simpler alternatives ?
Things seems much simpler with Typeorm than with mongoose, but Typeorm says that it has only a "basic support of mongodb"
Hi! My name Antonio, for friends Tony, I'm Full Stack Software Developer - Open Source enthusiast, TS/JS enthusiast, NestJS Contributor, passionate about NestJS, Fastify, Angular and React/Next.js
Everyone can use the methods and implementation they want, you are free to implement them however you like, the choice is yours. Then for the following questions you ask:
Is this the Nest way to use mongoose?
The implementation for using mongoose with Nest is this, I know maybe mongoose is a bit complex to understand.
Is there simpler alternatives ?
an alternative to mongoose?
Hi! My name Antonio, for friends Tony, I'm Full Stack Software Developer - Open Source enthusiast, TS/JS enthusiast, NestJS Contributor, passionate about NestJS, Fastify, Angular and React/Next.js
Hi Yann, don't worry, sometimes it can happen that you don't understand the code right away and you need some time to understand I've been through it too. Then in software development there will always be difficulties and understanding the code as it is written and why it was written that way.
When I first used Nest, I understood it in a flash, as if I had used it before, but I think it's because I know Angular from the first version and some things are very familiar to me.
However, if you have any doubts, write me without problems.
P.s. If you are having difficulty with Nest you can also use the Discord channel for support
Hi! My name Antonio, for friends Tony, I'm Full Stack Software Developer - Open Source enthusiast, TS/JS enthusiast, NestJS Contributor, passionate about NestJS, Fastify, Angular and React/Next.js
Yuk! So we have to define a several schema, a several DTOs and a couple interfaces (separately) for each model?
This is sorta ugly :/
Same feeling, the title is "Simple example Api Rest " but the implementation feels pretty complex and repetitive; and the nest documentation is not so clear either.
Is this the Nest way to use mongoose ? Is there simpler alternatives ?
Things seems much simpler with Typeorm than with mongoose, but Typeorm says that it has only a "basic support of mongodb"
Hi Yann,
Everyone can use the methods and implementation they want, you are free to implement them however you like, the choice is yours. Then for the following questions you ask:
Is this the Nest way to use mongoose?
The implementation for using mongoose with Nest is this, I know maybe mongoose is a bit complex to understand.
Is there simpler alternatives ?
an alternative to mongoose?
Actually your examples are okay, i was just not used to Nest so some stuff seemed redundant at first glance, but it is not.
Mongoose schema is dedicated to database and might have nested properties, ref to other collections etc
CreateUserDto can be different from schema for various reasons
You created UpdateUserDto from CreateUserDto to avoid dupplicating code
This makes sense now
Hi Yann, don't worry, sometimes it can happen that you don't understand the code right away and you need some time to understand I've been through it too. Then in software development there will always be difficulties and understanding the code as it is written and why it was written that way.
When I first used Nest, I understood it in a flash, as if I had used it before, but I think it's because I know Angular from the first version and some things are very familiar to me.
However, if you have any doubts, write me without problems.
P.s. If you are having difficulty with Nest you can also use the Discord channel for support
If you find other ways of implementation you are free to implement them as you like, the choice is yours.