1
0
Fork 0

added derived file

This commit is contained in:
Jan Steemann 2015-05-19 23:15:11 +02:00
parent db9e9d7c47
commit 9f6baaef1e
1 changed files with 8 additions and 3 deletions

View File

@ -603,13 +603,14 @@ function processQuery (query, explain) {
stringBuilder.appendLine();
printIndexes(indexes);
stringBuilder.appendLine();
printRules(plan.rules);
printModificationFlags(modificationFlags);
printWarnings(explain.warnings);
}
/* the exposed function */
function explain (data, options) {
function explain (data, options, shouldPrint) {
'use strict';
if (typeof data === "string") {
data = { query: data };
@ -626,9 +627,13 @@ function explain (data, options) {
stringBuilder.clearOutput();
processQuery(data.query, result, true);
print(stringBuilder.getOutput());
return stringBuilder.getOutput();
if (shouldPrint === undefined || shouldPrint) {
print(stringBuilder.getOutput());
}
else {
return stringBuilder.getOutput();
}
}
exports.explain = explain;