Our team is learning to work with MongoDB. We have to model the user among other things for an OAuth-based application. We know how to model in the relational world, but are unsure about how to do it in NoSQL.
In our application we identify the user uniquely by her email address. Email addresses are naturally unique and also verifiable. The email address seems to be a good candidate for a key.
We don't model the person. We don't have the possibility to identify a person, only her email address. That means, if a person has more than an email address, she would have several documents in the database. Also if she changes her email address she would use a different document. And also, because people login with OAuth, there's no concept of them managing their data. There's no password, and the user name is given by OAuth.
Why not using the email adress for a collection's primary key
_id? Like this:
_id: "[email protected]",
name: "John Doe",
// all comments
What are the pros and cons of such an approach?
Edited to clarify the difference between person and user