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

toPrimaryKey broke ObjectId from MongoDB #173

Open
Dotrox opened this issue Feb 2, 2021 · 1 comment
Open

toPrimaryKey broke ObjectId from MongoDB #173

Dotrox opened this issue Feb 2, 2021 · 1 comment

Comments

@Dotrox
Copy link

Dotrox commented Feb 2, 2021

When I get data from the server all ObjectId cuts because of this method.
For example "6018b21ff77a7f08047de270" become "6018"
And id: this.string() in vuex-orm models doesn't help!

return parseInt(input.toString(), 10);

Why the Hell there is parseInt without checking field type?!

@Arsync
Copy link

Arsync commented Mar 21, 2021

Same problem, my ids looks like tyr13zqj, without strange prefixes of $uid. We need just to set it as is. Why the Hell we have that conversion of existing data? Plugin must not to change data inside, it just a transport utility.

As workaround, maybe introduce option like 'custom id prefix', which we can set manually while installing the plugin:
u- for u-6018b21ff77a7f08047de270
or t for tyr13zqj.

But better to leave it without internal changes. If you have a string, you must show it as string.

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

No branches or pull requests

2 participants