2

I have a money management tool which has users. Each user may have several accounts/funds (e.g. bank account). For each account/fund there may be thousands of transactions.

Users may only view their accounts and transactions so no need for cross reference between different users like other apps (e.g. message board, where different users can view other peoples posts)

So, using a nosql database like mongodb, I would just create a single collection "users" and have the following schema:

{
    "id": ...
    "username": "joe"
    "password": "jkj23jk343krw..."
    "funds": {
        "name": "Bank of Scotland"
        "transactions": [
            {...}, {...}, ...
        ]
    },
    {
        "name": "Lloyds"
        "transactions": [
            {...}, {...}, ...
        ]
    },
}

...rather than having different collections (users, funds, transactions) as I might have tables in a Relational DB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.