Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/js-kyle/mongodb-changestream-demo
Demo repository for my talk on MongoDB Change Streams
https://github.com/js-kyle/mongodb-changestream-demo
Last synced: about 2 months ago
JSON representation
Demo repository for my talk on MongoDB Change Streams
- Host: GitHub
- URL: https://github.com/js-kyle/mongodb-changestream-demo
- Owner: js-kyle
- Created: 2024-03-11T20:13:28.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-12T21:42:02.000Z (10 months ago)
- Last Synced: 2024-10-14T09:16:15.555Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: change-stream.js
Awesome Lists containing this project
README
# MongoDB Change Stream demo
## Setup
### Prerequisites
**Start MongoDB container using Docker**
```bash
docker run -d --rm -p 27017:27017 --name mongo1 mongo:7 mongod --replSet rs0 --bind_ip_all
```**Configure MongoDB Replica Set**
```bash
docker exec mongo1 mongosh --quiet --eval "\
var rs = rs.initiate({\
'_id': 'rs0',\
'members': [{'_id': 0, 'host': 'localhost:27017'}]\
}).ok;\
print('Replica set init result', rs);
"
```**Install Node.js dependencies**
```bash
yarn
```**Run the Demo Change Stream**
```bash
yarn start
```Seed the database and make updates using the VSCode MongoDB Playgrounds.
### Helpful links
- [MongoDB Change Streams overview](https://www.mongodb.com/docs/manual/changeStreams)
- [Change Streams basics](https://www.mongodb.com/basics/change-streams)