tutanck/Regina

directly insert a document in mongodb then it not works

harishmahajan opened this issue · 1 comments

if we insert data from browser then i got data instantly to browser.

and if i open a mongodb and add a document in collection. it is not showing on browser.

my application flow is like
mobile app -> will insert data in mongodb collection -> a webportal will retrieve those data and display those data (Real time)

if we insert data from browser then i got data instantly to browser.
it's because you're warning regina that you want to perform an action on the database and regina runs the query for you and then broadcast the results to other clients.

but if you do not pass through regina to perform read / write operations on mongodb regina is not aware of changes to the database (there is no watcher on the mongo database)

If you want to be aware of every change in real time, every request to the database must be made by regina.

So, in your case, your mobile app must ask regina to make the insertions and your webportal must subscribe to the tags emitted by the mobile app always via regina.

see :
https://github.com/tutanck/Regina/blob/master/docs/How_It_Works.png