sub-sections of mongodb databases with mongojs
Ok. So let's say you're building a personal finance app for many customers, two of which are Alice and Bob.
You have to be very careful not to show Alice's expenses on Bob's account, so you MUST always remember to
account_id or such. Or you can use this module as following.
var mongojs = ;var submongojs = ;var db = ;// ...var accountId = ;var expenses = ;// Then from here on, we just use the mongojs APIexpenses;
npm install submongojs
The module is just one function.
submongojs(collection, idvalue, [idFieldName])
Then afterwards, you just need to use the mongojs collection API.