Demo for Orange County MUG Dec-5-2017
Steps:
- Setup a MongoDB 3.6 replica set
- Build using
mvn package
- Run using
java -jar ./bin/changestreams.jar --host MONGODB_CONNECTION_STRING
- Install mgeneratejs
- Generate data simultaneously using the V1 and V2 Device Event templates:
mgeneratejs -n 50000 36_DeviceEventsV1.json | ./mongoimport -d IoT -c DeviceEvents -j 2
mgeneratejs -n 50000 36_DeviceEventsV2.json | ./mongoimport -d IoT -c DeviceEvents -j 2
- As data is commited to the replica set, the change streams java program will print out events to the console
- After completion, browse the
IoT
database and theDeviceEvents
andDevices
collections using MongoDB Compass. - The
Devices
collection will contain only 1 entry per Device with variations in the json schema