Question: Given the class and data below; Using javascript and mongoose, Implement CRUD actions in your transactionmanager that perform the actions in the database. class Transaction

Given the class and data below;

Using javascript and mongoose, Implement CRUD actions in your transactionmanager that perform the actions in the database.

class Transaction {

constructor(id, date, description, category, amount){

this.id = id; this.date = date;

this.description = description;

this.category = category;

this.amount = amount; }

}

const getTransactions = () => {

const transactions = [];

transactions.push( new Transaction(1, "01/15/23", "jewelry sales", "credit", 350 ));

transactions.push( new Transaction(2, "01/17/23", "old antique sales", "credit", 2000 ));

transactions.push( new Transaction(3, "01/18/23", "product sales", "credit", 4550 ));

transactions.push( new Transaction(4, "01/20/23", "gift", "credit", 170 ));

return transactions; };

module.exports = {

getTransactions

};

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!