Enterprise Nest.js: Build an Abstract MongoDB Repository

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Sweet video, very informative and slick use abstract class.
Could be cool to do a video on multi-tenant setup in nestjs for example when different tenants have different db connections

hassan-qphn
Автор

as far as I know, repositories should be database agnostic, meaning it does not matter why database you are using, but I see that you extends Document from mongoose ?
can you please elaborate ?

Hamdiby
Автор

this whole series is gold. I has struggling to understand how to build apps like this. Thank you.

vk-fbox
Автор

Thanks so much for this and all your other videos. You're really well versed in nestjs and appreciate you sharing your knowledge!

williamx
Автор

Thank you. I need to figure out Postgres way :)

mkroven
Автор

this video and all your videos are helpful, all love💓

alihamoud
Автор

Thanks, great video. Just want to mention you may get some error in the projection part in find and findOne
"With the exception of the _id field, you cannot combine inclusion and exclusion statements in projection documents." so if you put __v: 0 and try to project other fields using {userId:1, email:1}
it will give an error since this does not allow in MongoDB. so in case if this happens you can remove the __v:0 part in the projection.

isurumaldeniya
Автор

thanks this helps a lot on improve my project. one question, how could I do the same with a service ? supose I have multiple service that wait for a event emitter "get.products" and all of them will execute another class that will return an array of products
how can I do this kind of abstraction?

odev
Автор

can we implement this kind of abtraction with ORMs like prisma ?
i tried to do it with prisma but the typing and the filterQuery doesnt exist as type in prisma

hoseinjahandideh
Автор

thank you so much for this guide i have small question can i ask in why you use exec() in abstract class but not use it before on UserRepository class

mohammadrezabehzadfar
Автор

Thank you very much i really like how you explain

ayoubguismi
Автор

Hi Michael, thank you for your videos. It is possible to implement Pagination on the abstact repository and how can I do that?

paneurhythmie
Автор

When I try new typescript warns that Argument of type 'unknown' is not assignable to parameter of type 'AnyKeys<T> & AnyObject'

sashatsatryan
Автор

Thanks for the video Michael!!
Could somebody please elaborate why unknown is used as a type for createEntityData and UpdateQuery? The object we would pass should always contain properties which are present in the Model right? So why unknown?

vighnesh-k
Автор

I'm wondering how could it look using aggregations

therealwalim
Автор

is there any default method / prototype that already created by mongoose so we can just use them with extends, like using typeorm we can just implements repository pattern with extends repository, and import { Repository } from typeorm

ikan
Автор

what if you want to implement other methods as well, like findByName etc

Xenonx
Автор

Hi) I have a question, can we create the abstract class for controllers and extend them, for example, CrudController? And pass somehow dto

dantedimon
Автор

Hi! Great tutorial, thankyou very much. I wanted to ask how do you manage situations when you have multiple schemas in their respective modules and lets say two of them are related with a "ref", and you to validate that there exists a record in the ref schema before you create a record in other schema?

Currently I do it by importing the ref schema in my second module, then import it in my service and have a check before the create function. Is it the right thing to do?

noname
Автор

Great vid, but it's not Repository in your specific case, it's DAO.

volodymyrkulyk