GlanceIt / GlanceService

Glance Service
1 stars 0 forks source link

Design DB for persisting user ratings #12

Closed mamadi closed 8 years ago

mamadi commented 8 years ago

User rating to spot is a 1-1 relationship.

mamadi commented 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 } }