mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 23:35:59 +00:00
fix nested mongo id as $oid #387
This commit is contained in:
@@ -9,7 +9,9 @@ const AbstractCursor = require('mongodb').AbstractCursor;
|
|||||||
const createBulkInsertStream = require('./createBulkInsertStream');
|
const createBulkInsertStream = require('./createBulkInsertStream');
|
||||||
|
|
||||||
function transformMongoData(row) {
|
function transformMongoData(row) {
|
||||||
return _.mapValues(row, (v) => (v && v.constructor == ObjectId ? { $oid: v.toString() } : v));
|
return _.cloneDeepWith(row, (x) => {
|
||||||
|
if (x && x.constructor == ObjectId) return { $oid: x.toString() };
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function readCursor(cursor, options) {
|
async function readCursor(cursor, options) {
|
||||||
|
|||||||
Reference in New Issue
Block a user