NickPriv / FryRankBackend

A back-end Java application allowing users to create and view reviews for french fries at restaurants
https://fryrank.oxyserver.com
0 stars 0 forks source link

Add accountId as review field sent by the frontend; don't allow users to have more than one review of each restaurant #63

Closed NickPriv closed 1 month ago

oxyflush commented 1 month ago

To accomplish users not having more than 1 review, we will change the ID in mongodb to be generated using the following formula:

[Google Restaurant ID]:[Google Account ID]

This allows the ID to be unique yet recreatable and this is important because when you put another entry into mongodb with the same ID using upsert, it will just replace the entry which means that each restaurant/user combo can only happen once which implies 1 user review for each restaurant.