mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fix nested mongo id as $oid #387
This commit is contained in:
parent
23cb3a4b12
commit
2a2debbb88
@ -9,7 +9,9 @@ const AbstractCursor = require('mongodb').AbstractCursor;
|
||||
const createBulkInsertStream = require('./createBulkInsertStream');
|
||||
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user