We are trying to find a proper way to abstract firebase CRUD operations, which are currently in many places in our node.js code. The reason is to be able to substitute firebase with another DB like mongoDB.
Our database contains relative deep data structures (up to 4 levels).
For example, one specific difficulty in the process is the way we do updates in firebase, which can be performed in many places using one update command. e.g:
updates[`users/${userUUID}/status`] = statusChange;
updates[`users/${userUUID}/email/`] = userEmail;
updates[`products/${productUUID}/colour/`] = colour;
firebase.database().ref().update(updates);
Is there any suggestion, for how to abstract the firebase CRUD?