mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 10:53:57 +00:00
feat: look into cursor's firstBatch in mongosh res
This commit is contained in:
@@ -103,6 +103,8 @@ const driver = {
|
|||||||
return printable;
|
return printable;
|
||||||
} else if ('documents' in printable) {
|
} else if ('documents' in printable) {
|
||||||
return printable.documents;
|
return printable.documents;
|
||||||
|
} else if ('cursor' in printable && 'firstBatch' in printable.cursor) {
|
||||||
|
return printable.cursor.firstBatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
return printable;
|
return printable;
|
||||||
@@ -169,6 +171,11 @@ const driver = {
|
|||||||
for (const row of printable.documents) {
|
for (const row of printable.documents) {
|
||||||
options.row(row);
|
options.row(row);
|
||||||
}
|
}
|
||||||
|
} else if ('cursor' in printable && 'firstBatch' in printable.cursor) {
|
||||||
|
options.recordset({ __isDynamicStructure: true });
|
||||||
|
for (const row of printable.cursor.firstBatch) {
|
||||||
|
options.row(row);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
options.info({
|
options.info({
|
||||||
printable: printable,
|
printable: printable,
|
||||||
|
|||||||
Reference in New Issue
Block a user