🔁Mongo Redis Sync
Archived script that copies vCons from Redis into MongoDB; read this before choosing it for a new deployment.
Repo: vcon-dev/mongo-redis-sync
The script copies in one direction only, from Redis to MongoDB. Despite the repo name it does not sync Mongo back into Redis.
It scans Redis keys matching
vcon:*at startup and writes each RedisJSON document to a Mongo collection withreplace_one(..., upsert=True), using the Redis key as_id.It then subscribes to Redis keyspace notifications and repeats the write on
set,hsetandjson.setevents. Deletions and expirations are not propagated.
Redis needs keyspace notifications enabled (notify-keyspace-events ExA) and RedisJSON. Settings come from environment variables, and the repo ships a Dockerfile and compose file.
See also
Last updated
Was this helpful?