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

Allow custom objectId #4170

Closed
drsounds opened this issue Sep 15, 2017 · 7 comments
Closed

Allow custom objectId #4170

drsounds opened this issue Sep 15, 2017 · 7 comments

Comments

@drsounds
Copy link

Issue Description

I want to be able to set custom objectId when saving new parse objects.

Steps to reproduce

let obj = new Parse.Object('Country');
obj.set('objectId', 'vr');
obj.set('name', 'Virtual Reality');

#### Expected Results

A parse with the objectId vr.
@drsounds drsounds changed the title Allow custom Id Allow custom objectId Sep 15, 2017
@flovilmart
Copy link
Contributor

It seem dangerous to allow the client overriding the objectId, you may end-up writing data in an unsuspected object.

What would be your use case?

@montymxb
Copy link
Contributor

@drsounds I would be concerned as well, immediately what comes to mind is accidentally overwriting an existing object. I think, considering the purpose of the ids to be a unique identifier, setting them in a potentially non-unique fashion could be troublesome. There would be no way to sanity check a potential override.

Perhaps what you're thinking of is a tag of sorts to categorize an object by? You can always add an additional field to perform such a task, and I'm sure everyone would recommend such an approach over setting custom ids. However I don't know why you want this, so let us know if there's something specific we're missing that this could be handy for.

@montymxb
Copy link
Contributor

Hey haven't heard anything so I'm going to go ahead and close this out. I would love to hear your use case though. If you want to continue discussing this feel free to let us know and we'll reopen it as needed!

@gausoft
Copy link

gausoft commented Jun 19, 2019

I got the same problem for this use case :
An application in an intranet network that have to send parse objects already saved in offline to online parse-server. The online object's Id is different.

@rhuanbarreto
Copy link
Contributor

Hi to all! Have a look on PR #6177 and share your thoughts! Now we can do this!

@tanzeelrana
Copy link

We should allow users to configure rules for parse objectId when they setup parse server. At the moment we have the possible chars hard coded here : https://github.com/parse-community/parse-server/blob/master/src/cryptoUtils.js#L26

const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789';

This makes things difficult when I am trying to integrate elastic search with parse server.

@tanzeelrana
Copy link

tanzeelrana commented Aug 19, 2024

update: this feature is now available in the documentation
https://parseplatform.org/parse-server/api/master/ParseServerOptions.html
allowCustomObjectId

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

6 participants