@hvedinich/utils 0.0.61 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -76,7 +76,7 @@ describe('buildDBModel', () => {
|
|
|
76
76
|
const removeResult = { deletedCount: 1 };
|
|
77
77
|
mockSchema.deleteOne.mockResolvedValue(removeResult);
|
|
78
78
|
|
|
79
|
-
const result = await dbModel.remove(mockId);
|
|
79
|
+
const result = await dbModel.remove({ id: mockId });
|
|
80
80
|
expect(result).toEqual(removeResult);
|
|
81
81
|
expect(mockSchema.deleteOne).toHaveBeenCalledWith({ id: mockId });
|
|
82
82
|
});
|
|
@@ -39,7 +39,7 @@ const buildDBModel = schema => {
|
|
|
39
39
|
* @param {String} id - The id of the document to remove.
|
|
40
40
|
* @returns {Promise<Object>} - The result of the remove operation.
|
|
41
41
|
*/
|
|
42
|
-
const remove =
|
|
42
|
+
const remove = filter => schema.deleteOne(filter);
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Counts the number of documents matching a filter.
|