Skip to content

untranspose method is removing properties containing MongoDb ObjectId #17

@js-d-coder

Description

@js-d-coder

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'
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions