hola-server 0.3.17 → 0.3.18
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/db/entity.js +10 -0
- package/package.json +1 -1
package/db/entity.js
CHANGED
|
@@ -745,6 +745,16 @@ class Entity {
|
|
|
745
745
|
return this.db.delete(this.meta.collection, query);
|
|
746
746
|
}
|
|
747
747
|
|
|
748
|
+
/**
|
|
749
|
+
* Remove the records from mongodb
|
|
750
|
+
* @param {*} id can be array or string
|
|
751
|
+
* @returns
|
|
752
|
+
*/
|
|
753
|
+
delete_by_id(id) {
|
|
754
|
+
const query = Array.isArray(id) ? oid_queries(id) : oid_query(id);
|
|
755
|
+
return this.db.delete(this.meta.collection, query);
|
|
756
|
+
}
|
|
757
|
+
|
|
748
758
|
/**
|
|
749
759
|
* Find the objects that are refered by other entity
|
|
750
760
|
* @param {ref value} value
|