Port all the databases to a better tech
ameykshirsagar opened this issue · comments
How can I port the internal database of open platform from file based JSON storage to a better one like MongoDB??
Thanks
Hi @ameykshirsagar,
I think that it's not a problem. But users must be read into the memory.
Just update:
- save users
https://github.com/totaljs/openplatform/blob/master/definitions/openplatform.js#L55 - load users
https://github.com/totaljs/openplatform/blob/master/definitions/openplatform.js#L71
But you have to update applications and settings too. It's not complicated.
Thank you!
@petersirka : I tried the mongoose utilisation and so far I am able to do basic auth & users CRUD. But the notify part isn't working as it should.
Did you mean notifications?
If yes then update only two methods:
User.prototype.getNotifications
:
https://github.com/totaljs/openplatform/blob/master/models/model-user.js#L77
User.prototype.notify
:
https://github.com/totaljs/openplatform/blob/master/models/model-user.js#L107
It should work.
Alright cool. Thanks a lot @petersirka