[06:05:06] <EtherNet> is anyone awake? I've got a quick question
[06:07:23] <EtherNet> I am working with php and I need to get the amount (count) of items in a collection. I mean the same result I get running db.count() on the shell, I need to execute it through php and I can't find the way
[18:00:12] <kenalex> I am creating a system that will have vouchers that can be redeemed by users. the vouchers are divided in batches. SO there is a one to many relationship between VoucherBatch and Vouchers. What is the best way to implement this ? is the embedded format best where a list of vouchers are embedded in a batch ?
[18:12:33] <StephenLynx> any reason you have vouchernumber instead of using the _id?
[18:13:20] <kenalex> no. that document is a test I was doing testing it as a sub document inside of Batch. it can made to be _id
[18:13:33] <StephenLynx> anyway, you don`t want to duplicate the whole documents. i`d keep them on separate collections and have an array containing the ids of related documents.
[18:13:43] <StephenLynx> then, duplicate batch or voucher ids?
[18:13:48] <StephenLynx> that depends on how you are going to query it.
[18:15:56] <kenalex> so i could either have an array of voucher ids in Batch or assign a batchId field in each individual voucher ?