I'm trying to create a server of this general format that returns JSON (for use by a client) instead of rendering HTML. However, it returns the JSON with all the metadata from both node-neo4j and Neo4j itself. All I want is the data. This is relatively easy to filter at the top level (ex. routes/users.js) except for functions returning multiple results like User.getAll. I tried modifying the lower level models/users.js, but then it became evident that the User prototype wrapper is useful for combined queries like a User.get followed by user.getFollowingAndOthers. I can think of some ways to rearchitect this for this use case, but any thoughts on how to do it in a sane way?
I'm trying to create a server of this general format that returns JSON (for use by a client) instead of rendering HTML. However, it returns the JSON with all the metadata from both node-neo4j and Neo4j itself. All I want is the data. This is relatively easy to filter at the top level (ex. routes/users.js) except for functions returning multiple results like User.getAll. I tried modifying the lower level models/users.js, but then it became evident that the User prototype wrapper is useful for combined queries like a User.get followed by user.getFollowingAndOthers. I can think of some ways to rearchitect this for this use case, but any thoughts on how to do it in a sane way?