UNPKG

@everytravel/shared

Version:

A comprehensive shared package for Everytravel containing Mongoose models and CRUD operations for hotel booking, user management, and transaction handling. Updated with improved model syntax and enhanced error handling.

11 lines (10 loc) 276 B
/** * Delete operations for Mongoose models */ export const deleteOne = async (Model, filter) => { try { return await Model.findOneAndDelete(filter); } catch (error) { throw new Error(`Error deleting document: ${error.message}`); } };