I think there is a bug where untranspose method is removing properties containing MongoDb ObjectId. I can demonstrate that with following TypeScript code:
import { ObjectId } from "mongodb";
const DataObjectParser = require("dataobject-parser");
const obj = {
orderId: new ObjectId(),
location: {
city: {
name: "House on cliff",
geo: '45, 23'
}
}
}
console.log(DataObjectParser.untranspose(obj));
Actual output of console.log is as follows:
{
'location.city.name': 'House on cliff',
'location.city.geo': '45, 23'
}
Expected output of console.log is as follows:
{
'orderId': ObjectId(...),
'location.city.name': 'House on cliff',
'location.city.geo': '45, 23'
}