diff --git a/src/Book.ts b/src/Book.ts index ba84288..8d1a5e4 100644 --- a/src/Book.ts +++ b/src/Book.ts @@ -22,6 +22,7 @@ const GROUP = { _id: null, balance: { $sum: { $subtract: ["$credit", "$debit"] } }, notes: { $sum: 1 }, + lastTransactionId: { $max: "$_id" }, }, }; @@ -109,9 +110,6 @@ export class Book