not-node 5.0.12 → 5.0.13

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "5.0.12",
3
+ "version": "5.0.13",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -74,13 +74,15 @@ function sanitizeInput(input) {
74
74
  * @static
75
75
  * @param {string} id primary key
76
76
  * @param {Array} population optional if needed population of some fields
77
+ * @param {Object} condition optional if needed additional condition
77
78
  * @return {Promise} Promise
78
79
  **/
79
- function getOne(id, population = []) {
80
+ function getOne(id, population = [], condition = {}) {
80
81
  let query;
81
82
  if (this.schema.statics.__versioning) {
82
83
  query = this.findOne({
83
84
  _id: id,
85
+ ...condition,
84
86
  __latest: true,
85
87
  __closed: false
86
88
  });
@@ -91,7 +93,8 @@ function getOne(id, population = []) {
91
93
  }
92
94
  } else {
93
95
  query = this.findOne({
94
- _id: id
96
+ _id: id,
97
+ ...condition
95
98
  });
96
99
  }
97
100
  populateQuery(query, population, this.schema.statics.__versioning);