Skip to content

PUT in REST API does not upsert object with custom ID #7139

Open
@ArkeshGKalathiya

Description

@ArkeshGKalathiya

New Feature / Enhancement Checklist

Current Limitation

When integrating third party apis with server, most of them already provide the unique ids for the returned data. So right now if I want to save object with custom id it requires restful api call from node environment, and to make restful api call ( batch request ), we need to check with the server if object with custom id exist or not. If object exist then batch array requires PUT otherwise it requires POST. So it is kind of little overhead and extra management of the code. And also in fast updating environment it can cause errors ( where multiple node in same cluster checks with the backend if certain object id exist, it can cause race conditions ). so It would be nice to have support for saving objects in node environment without rest apis, and maybe upsert option when saving parse object.

Feature / Enhancement Description

So It would be great to have feature where parse server sdk supports saving object based on custom object ids ( it doesn't support at the moment in cloud code and server sdk, it requires rest api cal in node environment to save such objects with custom object id ) and one flag with something like Parse.Object.save({},{upsert:true}), which updates existing documents if object id is already there in database.

Alternatives / Workarounds

Making redundant requests to check if object exist in server

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions