on using the strategy pattern to switch between database layers
Typically you'd have two classes that implement the four methods create, read, update and delete, one for Mongo and one for PostGres. Create a factory method that determines what kind of DB you are talking to, and returns an instance of the appropriate class.
The rest of your code can interact with the class using the methods. It doesn't need to know what kind of DB you are using.