Parse-SDK-dotNET icon indicating copy to clipboard operation
Parse-SDK-dotNET copied to clipboard

Specify custom objectId when creating objects

Open yinzara opened this issue 1 year ago • 2 comments

As implemented in Parse server: https://github.com/parse-community/parse-server/pull/6177 and in the Parse JS client: https://github.com/parse-community/Parse-SDK-JS/pull/1309

It is possible to create ParseObject(s) with a predefined ObjectId. This allows for use cases where Parse is not the system of record of the IDs of entities are defined in some external system. This is done by calling the standard POST /classes/{className} API but specifying the "objectId" as a parameter of the object being submitted NOT by calling the PUT /classes/{className}/{objectId}

The Parse-SDK-dotNET does not allow this. If you specify an ObjectId on an object, it will attempt to use the PUT API and update the object failing to create the object.

The ParseJS SDK uses the presence of the "createdAt" property to know if it was ever retrieved instead of using the ObjectId to determine if PUT or POST should be used.

yinzara avatar Aug 07 '24 01:08 yinzara

Thanks for opening this issue!

This is major issue and the allowCustomObjectId flag is not of any use as sdks switch to put if we define the custom id.

ravikumarmistry avatar Mar 31 '25 09:03 ravikumarmistry