Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize the id if its an ObjectID, fixes #5 #22

Closed
wants to merge 4 commits into from

Conversation

myartsev
Copy link

I took a stab at fixing #5

Note: I imagine that the other fields in a mongo DB could also be ObjectIDs.
Should those be serialized as well? I don't want to open a can of worms in this PR,
so here I fix the ID field which is a very common scenario.
We can open another issue regarding other fields.

@myartsev
Copy link
Author

myartsev commented Sep 24, 2017

TypeError: clone[primaryKey].toHexString is not a function
That's strange. Apparently ObjectID.isValid(1) returns true...

Looks like a bug with the MongoDB driver, I'll check with them.
In the meantime I'll change how to determine if this field is an ObjectID.
Apologies for all the noise, should have ran the tests locally.

…ug with the MongoDB driver.

In the meantime, adjusting the way to determine if the ID field is an ObjectID.
@myartsev
Copy link
Author

Retracting pull request.
While this works for find, it breaks down in other areas; relationships, updates & deletes.

Need a more complete solution to support Object IDs across the board.

@myartsev myartsev closed this Sep 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant