Skip to content

Feature - Translate all ObjectID fields #16

@crobinson42

Description

@crobinson42

There are cases where someone may implement js-data-mongodb towards a pre existing Mongo database collection and some libraries (ORM's) that perform relational mapping store record _id's in the ObjectID bson value, ie: { "_bsontype": "ObjectID", "id": { "type": "Buffer", "data": [87,...156] } }.

When using js-data-mongodb, it would be convenient to pass an option to translate all ObjectID fields to a string.

I would apply the logic in the method _translateIds() on line 218 and change the name and all references to it to "_translateObjectIDs()".

@jmdobry If you'll accept this feature, I'll put in a PR. Please let me know.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions