replication MONGODB
Closed this issue · 5 comments
Hello,
Today I have in the backend an application with mongoDB and I'm building my frontend in PWA, how can I use in frontend the minimongo with synchronization, for my MongoDb backend database?
You'll need to create a server layer that converts the REST calls to Mongo calls. See RemoteDb for details on how the calls look.
perfect @grassick , but is there any data change event?
So I would get this event and the data that changed, and would call my API and it would update the mongoDB.
The HybridDb will sync local changes to the server when upload
is called.
@grassick Let me just see if I understand the whole concept.
1 - when you save a data, it saves local and after save local it synchronizes with the database on the server, this?
hybridDb = new HybridDb (localDb, remoteDb)
2 - making the call above, automatically it is already ready to send to the server?
3 - Another doubt, if the application goes offline, it will save normal locally and when it comes online again, does it do this automatic synchronization through hybridDb?
4 - Has demo used in hybridDb?
Yes, exactly. Do all operations on the HybridDb and then it will use the localDb only when offline.