Closed zenners closed 7 years ago
never mind :)
const mongoose = require('mongoose');
var journal = mongoose.model('Medici_Journal');
router.get('/journal', function(req,res,next){
journal.find({})
.populate('_transactions')
.exec(function(err,entries){
res.send(entries)
})
})
does the trick
Hello,
I've been playing around your lib and like it a lot. I was wondering how I would go about adding a method to get the journal entries and populate those with the debits and credits. I have a usecase where I would need to upload the entries to an external accounting system.
I looked into the source and saw the
this.journalModel = mongoose.model('Medici_Journal');
and of course have used the
ledger()
method.Would I just follow the same style of the ledger method and populate the ID's normally in mongodb?
Kindly advise, I can even put in a PR if this feature is warranted. :)