hola-server 0.7.8 → 0.8.1
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/db.js +3 -3
- package/package.json +1 -1
- package/router/read.js +1 -1
package/db/db.js
CHANGED
|
@@ -131,12 +131,12 @@ const bulk_update = async (col, items, attrs) => {
|
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
class DB {
|
|
134
|
-
constructor(url,
|
|
134
|
+
constructor(url, options, callback) {
|
|
135
135
|
if (!url) {
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
this.db = mongoist(url,
|
|
139
|
+
this.db = mongoist(url, options);
|
|
140
140
|
|
|
141
141
|
this.db.on("error", function (err) {
|
|
142
142
|
if (is_log_error()) {
|
|
@@ -368,7 +368,7 @@ const get_db = (callback) => {
|
|
|
368
368
|
} else {
|
|
369
369
|
const mongo = get_settings().mongo;
|
|
370
370
|
|
|
371
|
-
db_instance = new DB(mongo.url, mongo.
|
|
371
|
+
db_instance = new DB(mongo.url, mongo.options, callback);
|
|
372
372
|
return db_instance;
|
|
373
373
|
}
|
|
374
374
|
};
|
package/package.json
CHANGED
package/router/read.js
CHANGED
|
@@ -91,7 +91,7 @@ const init_read_router = function (router, meta) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
const query = meta.list_query ? await meta.list_query(entity, param_obj) : null;
|
|
94
|
+
const query = meta.list_query ? await meta.list_query(entity, param_obj, req) : null;
|
|
95
95
|
const { code, err, total, data } = await entity.list_entity(query_params["_query"], query, param_obj);
|
|
96
96
|
if (!has_value(code)) {
|
|
97
97
|
throw new Error("the list_entity method should return code");
|