Mongoose Change Streams with TypeScript - watch()

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


In this video, we explore Mongoose Change streams with TypeScript. Change streams are accessed through the .watch API on your Mongoose model. They require replica sets to work so make sure you create a MongoDB instance with replica sets enabled.

🌎 Follow me here:
Рекомендации по теме
Комментарии
Автор

Love you man, thank you so much for this content, it's wonderful how you share this information in depth, while at the same time you make the viewer understand how to develop a certain train of thought, so they can themselves recreate what is taught. Please keep making the world a better place with tutorials like this.

AnanyaKaushik-crrp
Автор

Thank you❤, it is help full for typesense

Venkatesh-vmll
Автор

this tutorial made me think about using this watch stream on an IoT system. When data comes to the server, we update the last data of the device. at the same time, we can check the alarms. thank you again

beratdinckan
Автор

Hello Tom. I got my first dev job two weeks ago. And you’re almost at 1000 subscribers! I’m pretty sure I’m one of the first 20 subscribers ahahah!

IkraamDev
Автор

Very helpful, but I think you docker-compose file isn working anymore. It always says Server selection timed out after 30000 ms when trying to connect. Any Ideas?

pxlloewe
Автор

Thank you for the tutorial. Never saw it someone using, so you use in your projects? If yes, what are the use cases?

tarik
Автор

Connected to database
MongoError: The $changeStream stage is only supported on replica sets

when i run the application, this error still shows up.

I did run the docker file, what should i do?

siraccevizci
Автор

What if an application is running on multiple servers, and if something is updated then a service has to be called. Will it be called multiple times? If yes, how can we handle this?

bhupenpal
Автор

What is the best procedure to update the document within the event handler? I want to edit a value directly for new documents. But data.fullDocument is not a model object on which I could call the .save() function. Can I somehow get such an object easily, or would I have to execute a Model.findById with the ID of the "fullDocument"? Doesn't feel so good to then have to search for each document again to have it as a model object.

Nono
Автор

I'm in love with your content💚💚💚💚💚💚. However, I have a question spinning in my head, I was trying to deal with two different collections inside change-stream events. One collection on watch mode listens on the 'insert' event, and my goal is to push/set the newly inserted data/_id to another collection using the updteOne method. My attempts failed, and the function returns a null value. I would be grateful if you help out by replying or making a follow-up video.

apuobaidur
Автор

Is there any way to get user _id with after watch. (The user who did it)

farazrazi
Автор

Great stuff! 👌
Could a make a video on postgres/mysql db modeling with typescript?

barebears
Автор

Hi, I have followed your tutorials and used Mongoose in pair with TypeScript since then and I still cannot get over the horrendous Intellisense speed that Mongoose provides, it slows down VS Code so much it becomes aweful to use. I see today that you suffer from the same thing and been wondering how come you still use it !?

JohnWick-idpk