mongoid fix

This commit is contained in:
Jan Prochazka
2022-01-05 08:50:23 +01:00
parent 232b52d939
commit bcda12db90

View File

@@ -9,7 +9,7 @@ const Cursor = require('mongodb').Cursor;
const createBulkInsertStream = require('./createBulkInsertStream');
function transformMongoData(row) {
return _.mapValues(row, (v) => (v && v.constructor && v.constructor.name == 'ObjectID' ? { $oid: v.toString() } : v));
return _.mapValues(row, (v) => (v && v.constructor == ObjectId ? { $oid: v.toString() } : v));
}
function readCursor(cursor, options) {