feat: look into cursor's firstBatch in mongosh res

This commit is contained in:
Pavel
2025-07-24 18:48:58 +02:00
parent 732763689a
commit 9f85b6154d

View File

@@ -103,6 +103,8 @@ const driver = {
return printable;
} else if ('documents' in printable) {
return printable.documents;
} else if ('cursor' in printable && 'firstBatch' in printable.cursor) {
return printable.cursor.firstBatch;
}
return printable;
@@ -169,6 +171,11 @@ const driver = {
for (const row of printable.documents) {
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 {
options.info({
printable: printable,