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

feat: Add $setOnInsert operator to Parse.Server.database.update #8790

Merged
merged 5 commits into from
Oct 25, 2023

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Oct 25, 2023

Pull Request

Issue

Closes: #8792

Approach

Add support for $setOnInsert.

Tasks

  • Add tests

@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title feat: add $setOnInsert operator to Parse.Server.database.update feat: Add $setOnInsert operator to Parse.Server.database.update Oct 25, 2023
@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 25, 2023

Thanks for opening this pull request!

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (686a9f2) 94.11% compared to head (9f44f35) 94.09%.
Report is 1 commits behind head on release-5.x.x.

❗ Current head 9f44f35 differs from pull request most recent head 8eb1866. Consider uploading reports for the commit 8eb1866 to get more accurate results

Additional details and impacted files
@@                Coverage Diff                @@
##           release-5.x.x    #8790      +/-   ##
=================================================
- Coverage          94.11%   94.09%   -0.03%     
=================================================
  Files                184      184              
  Lines              13809    13814       +5     
=================================================
+ Hits               12997    12998       +1     
- Misses               812      816       +4     
Files Coverage Δ
src/Adapters/Storage/Mongo/MongoTransform.js 88.31% <66.66%> (-0.11%) ⬇️
src/Controllers/DatabaseController.js 93.70% <0.00%> (-0.27%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mtrezza mtrezza linked an issue Oct 25, 2023 that may be closed by this pull request
3 tasks
@mtrezza mtrezza merged commit c4a4a2a into parse-community:release-5.x.x Oct 25, 2023
25 of 26 checks passed
@mtrezza mtrezza deleted the feat/add-setOnInsert branch October 25, 2023 18:41
parseplatformorg pushed a commit that referenced this pull request Oct 25, 2023
# [5.6.0](5.5.6...5.6.0) (2023-10-25)

### Features

* Add `$setOnInsert` operator to `Parse.Server.database.update` ([#8790](#8790)) ([c4a4a2a](c4a4a2a))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.6.0

@parseplatformorg parseplatformorg added the state:released-5.x.x Released as LTS version label Oct 25, 2023
@oallouch
Copy link
Contributor

Hi,
I can't find the corresponding API change in the JS SDK.

@mtrezza
Copy link
Member Author

mtrezza commented Oct 30, 2023

This is a Cloud Code only feature.

@oallouch
Copy link
Contributor

So the API has to be so low level ? I could be wrong, but the js sdk is also for Cloud Code.
Are we supposed to write "__op" in our code ?

@mtrezza
Copy link
Member Author

mtrezza commented Oct 30, 2023

Parse.Server gives you access to undocumented APIs, with various levels, ranging from just below the official Parse APIs down to the raw MongoDB driver. In the case of this issue here, there is no Parse SDK involved (apart from the namespace); this is operating on the internal database adapter level. If you decide to use this, extensive testing is advised, see also #8786.

@oallouch
Copy link
Contributor

Very interesting.
I still use Config.get(Parse.applicationId).database

chaiyen123

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released-5.x.x Released as LTS version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add $setOnInsert operator to Parse.Server.database.update
4 participants