const { model: trashbinModel } = require('./db/trashbin.schema');

const createUserTrashbin = (userId) => {
	// access trashbin model
	const trashbin = trashbinModel({
		userId,
	});
	return trashbin.save();
};

const updateUserTrashbin = (userId, data = {}) => {
	// access trashbin model
	return trashbinModel.updateOne({ userId }, data, { upsert: true });
};

module.exports = {
	createUserTrashbin,
	updateUserTrashbin,
};

@@ -232,22 +232,24 @@
 shbin = 
-(userI
+async (i
 d, data 
@@ -290,73 +290,109 @@
 el%0A%09
-return trashbinModel.updateOne(%7B userId %7D, data, %7B upsert: true %7D
+const trashbin = await trashbinModel.findById(id).exec();%0A%09trashbin.set(data);%0A%09return trashbin.save(
 );%0A%7D

Use Mongoose functions for updating