apachols / shorttrack

Open source speed dating in node.js
2 stars 0 forks source link

Fix user / profile relationship in database #46

Open apachols opened 10 years ago

apachols commented 10 years ago

Profile should just be an object within the user object, and not a reference. We originally did it like this because it wasn't clear that mongoose doesn't handle sub-document schemas in a human understandable way.

We can still have a separate profile object with its own methods (important), we just need to list the profile as a plain javascript object and not a sub-document in the user schema. Before we do this, though, we need to figure out how to construct a Profile schema'd object from the returned native javascript object after the user is retrieved from the DB.