Skip to content

Commit e3f1c05

Browse files
authored
Merge pull request #5628 from Countly/anna/next
Anna/next
2 parents cc4f7b4 + dda7613 commit e3f1c05

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

api/utils/requestProcessor.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -2130,8 +2130,16 @@ const processRequest = (params) => {
21302130

21312131
dbUserHasAccessToCollection(params, params.qstring.collection, (hasAccess) => {
21322132
if (hasAccess) {
2133+
var dbs = { countly: common.db, countly_drill: common.drillDb, countly_out: common.outDb, countly_fs: countlyFs.gridfs.getHandler() };
2134+
var db = "";
2135+
if (params.qstring.db && dbs[params.qstring.db]) {
2136+
db = dbs[params.qstring.db];
2137+
}
2138+
else {
2139+
db = common.db;
2140+
}
21332141
countlyApi.data.exports.fromDatabase({
2134-
db: (params.qstring.db === "countly_drill") ? common.drillDb : (params.qstring.dbs === "countly_drill") ? common.drillDb : common.db,
2142+
db: db,
21352143
params: params,
21362144
collection: params.qstring.collection,
21372145
query: params.qstring.query,

0 commit comments

Comments
 (0)