Feature: returns a list of entries when creating, editing or deleting an entry

This commit is contained in:
2015-08-14 14:35:00 +00:00
parent ffbc4f4980
commit 399a8717d3
3 changed files with 72 additions and 16 deletions

View File

@@ -16,5 +16,8 @@ var EntrySchema = new Schema({
created_at: {type: Date, default: Date.now}
});
EntrySchema.index({account_id: 1, date: -1, type: 1});
EntrySchema.index({account_id: 1, date: -1, category: 1, sub_category: 1});
var Entry = mongoose.model('Entry', EntrySchema);
module.exports = Entry;