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.
Files changed (2) hide show
  1. package/db/entity.js +10 -0
  2. 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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hola-server",
3
- "version": "0.3.17",
3
+ "version": "0.3.18",
4
4
  "description": "a meta programming framework used to build nodejs restful api",
5
5
  "main": "index.js",
6
6
  "scripts": {