mongosuper
Version:
mongosuper is a superset of mongoose. It is a wrapper around mongoose. It manage your mongoose connection and keep it alive always. It also provide you some extra features like CRUD operations, etc.
28 lines • 1.84 kB
TypeScript
/**
* This is an async function in JavaScript that updates data in a MongoDB database based on a filter
* and returns a status message, count of updated data, and the updated data.
* @param Filter - The filter parameter is an object that specifies the criteria for selecting the
* documents to update. It can contain one or more key-value pairs, where each key represents a field
* in the document and the corresponding value represents the value to match against.
* @param data - "data" is an object that contains the updated values for the document(s) that match
* the filter criteria. The keys of the object represent the fields to be updated, and the values
* represent the new values for those fields.
* @param model - The model parameter refers to the Mongoose model that represents the collection in
* the MongoDB database that needs to be updated.
* @param MultiUpdate - MultiUpdate is a boolean parameter that determines whether to update multiple
* documents that match the filter criteria or just update a single document. If MultiUpdate is set to
* true, the function will use the updateMany method to update all documents that match the filter
* criteria. If MultiUpdate is set to false, the
* @returns an object with the following properties:
* - status: a boolean value indicating whether the update was successful or not
* - message: a string message describing the result of the update operation
* - UpdatedCount: a number indicating the count of documents that were updated
* - UpdatedData: the updated data as an array of objects, or null if the update was not successful.
*/
export function Update(Filter: any, data: any, model: any, MultiUpdate: any): Promise<{
status: boolean;
message: string;
UpdatedCount: any;
UpdatedData: any;
} | undefined>;
//# sourceMappingURL=Update.d.ts.map