Im currently in the mist of building my price checker.
I realize while making this app after you receive your results back from the api and you need to update your database based on the data already there in mongoDB.
Meaning specifically I would need to add to the like count if user ip address has not be stored in the database.
I can find the document and based on the returned document I can place another request to update/modify using either callback or promises. But for me this logic seems wrong as I would be accessing the database twice.
My question is this the right method to achieve this? or is there way I can place this logic in the mongoDB request so I do not have to access the database twice?
I looked into mongodb " Aggregation" and conditionals, but I could not find a good answer on this.
Anyways any thoughts on this would be appreciated.
Jay