Closed mamadi closed 8 years ago
Created a new collection in mongo DB (ratingcollection).
Created an index on (user,spot):
db.ratingcollection.createIndex({User:1, Spot:1}, {unique:true});
Sample data:
{ "_id": ObjectId("xxxxxxxxx"), "User": "Admin", "Spot": "Starbucks-Irvine-1", "Ratings": { "Wifi": 0, "Staff": 0, "Coffee": 0, "Seating": 0, "Parking": 0, "Overall": 0 } }
User rating to spot is a 1-1 relationship.