I come from many years working with SQL Server. I am working now on a mobile game using GameSparks as the back-end which only supports NoSQL run on Mongo.
I am creating a Computer Card Game and am trying to get my head around the best-practice for creating documents in collections which relate to other documents in a different collection.
For example, I have a "player" collection which contains the players information: email address, username, that sort of stuff.
I have a separate collection called "playerCards". This contains one document per player, similar to the "player" collection. The document here would be link-able back to the player by the playerID which is sourced from the player collection.
What's the best practice in these cases where I have a 1-1 relationship for creating the key? Should my playerCards collection have a "playerId" as the index for its own collection? OR, should playerCards have its own _id->$oid index, which is unique for itself, and have "playerId" just be an attribute on the document?
I have this pattern over and over in my design, with "playerDecks" (representing the decks the player builds), etc..
Thanks for any help!