Skip to content

#6101 Let users define objectId - #6177

Merged
dplewis merged 15 commits into
parse-community:masterfrom
rhuanbarreto:patch-1
Dec 17, 2019
Merged

dplewis merged 15 commits into
parse-community:masterfrom
rhuanbarreto:patch-1

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

This PR is a start of an idea discussed on issue #6101. Was created as a recommendation by @dplewis

This commit was a try to enable the generation of IDs on client-side.

I'm don't have much knowledge on Parse, but if someone give me guidance, I can do all the work.

@davimacedo

Copy link
Copy Markdown
Member

Can you please take a look at the failing tests?

@rhuanbarreto

Copy link
Copy Markdown
Contributor Author

I will do! I will try to work on this this week.

Comment thread src/RestWrite.js Resolved
@JeromeDeLeon

Copy link
Copy Markdown
Contributor

@rhuanbarreto you can start off by checking the failing test in CI. I tried pushing changes but got denied.

@rhuanbarreto

Copy link
Copy Markdown
Contributor Author

I opened my repository to edits publicly. I also merged your changes into the branch in this PR.

@codecov

codecov Bot commented Dec 9, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #6177 into master will decrease coverage by 2.82%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6177      +/-   ##
==========================================
- Coverage   93.81%   90.99%   -2.83%     
==========================================
  Files         167      169       +2     
  Lines       11299    11957     +658     
==========================================
+ Hits        10600    10880     +280     
- Misses        699     1077     +378
Impacted Files Coverage Δ
src/Options/index.js 100% <ø> (ø) ⬆️
src/Options/Definitions.js 100% <ø> (ø) ⬆️
src/RestWrite.js 93.79% <100%> (-0.13%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 74.98% <0%> (-22.11%) ⬇️
src/GraphQL/helpers/objectsQueries.js 90.35% <0%> (-7.69%) ⬇️
src/GraphQL/transformers/constraintType.js 86.95% <0%> (-7.49%) ⬇️
src/ParseServer.js 91.56% <0%> (-6.03%) ⬇️
src/middlewares.js 97.17% <0%> (-1.12%) ⬇️
src/Adapters/Auth/twitter.js 96% <0%> (-0.43%) ⬇️
src/GraphQL/loaders/parseClassTypes.js 94.23% <0%> (-0.25%) ⬇️
... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a5fed8...b267d16. Read the comment docs.

Comment thread src/RestWrite.js Resolved
@JeromeDeLeon

Copy link
Copy Markdown
Contributor

@rhuanbarreto Can you verify the failing test? I can't seem to run mongodb-runner on my end. Thanks.

@davimacedo davimacedo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. @dplewis @acinader thoughts?

@dplewis

dplewis commented Dec 17, 2019

Copy link
Copy Markdown
Member

@davimacedo I want to try something. It looks good to me.

@dplewis dplewis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @BufferUnderflower @rhuanbarreto @JeromeDeLeon Thanks for working together to get this done!

Comment thread spec/rest.spec.js Resolved
@dplewis
dplewis merged commit 8bc201d into parse-community:master Dec 17, 2019
@rhuanbarreto
rhuanbarreto deleted the patch-1 branch January 13, 2020 12:13
UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this pull request Mar 21, 2020
* parse-community#6101 Let users define objectId

* Add `allowCustomObjectId` to PS Option

* Add checking in objectId creation

* Add test

* Update docs

* Update definition

* Change default to false

* throw on empty, null, undefined

* better tests

* unused async

* removed comment

* retain comment

* Linting fix according to contributing spec.
@TanzimChowdhury

TanzimChowdhury commented Jun 20, 2020 •

Copy link
Copy Markdown

Hello , i've changed the allowCustomObjectId to true in server settings in back4app. I can create a new object with custom Id through REST API. But when I try to do it through cloud code i get this error
{ "code": 101, "error": "Object not found." }
My cloud is is as follows:

const GameScore = Parse.Object.extend("GameScore");
const gameScore = new GameScore();
gameScore.set("objectId", "8YgwDJ19qX");
gameScore.set("name","nat");
return await gameScore.save(null,{useMasterKey:true});

Help would be really appreciated.

@JeromeDeLeon

Copy link
Copy Markdown
Contributor

Hello, your concern is duplicate of #6733.

@TanzimChowdhury

Copy link
Copy Markdown

Yes it seem's like my concern is a duplicate , do you think this will be resolved anytime soon ?

@JeromeDeLeon

Copy link
Copy Markdown
Contributor

not at the moment. You could use http request inside cloud code to support your use case.

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.

6 participants