I am creating a server application that interacts with the world through a RESTful web service and uses MongoDB for storage. As this happens, the web service JSON resources are pretty close to the structure of the BSON documents stored in Mongo.
While I usually use the object-oriented abstraction of DAO to hide the details of the implementation of persistence, this is not entirely suitable in this case, since I really want to make a document extraction from the database based on the query and perform the conversion . Building a graph of the object as an intermediary seems excessive.
Does anyone have any recommendations on an abstraction pattern that matches this account?
Edit: Removed 1 AM-degression only that you are not using abstraction and just using the Mongo driver.
source
share