Skip to content

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

Merged
mtrezza merged 5 commits into
parse-community:release-5.x.xfrom
mtrezza:feat/add-setOnInsert
Oct 25, 2023
Merged

feat: Add $setOnInsert operator to Parse.Server.database.update#8790
mtrezza merged 5 commits into
parse-community:release-5.x.xfrom
mtrezza:feat/add-setOnInsert

Conversation

@mtrezza

@mtrezza mtrezza commented Oct 25, 2023

Copy link
Copy Markdown
Member

Pull Request

Issue

Closes: #8792

Approach

Add support for $setOnInsert.

Tasks

  • Add tests

@parse-github-assistant

Copy link
Copy Markdown

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

parse-github-assistant Bot commented Oct 25, 2023

Copy link
Copy Markdown

Thanks for opening this pull request!

@codecov

codecov Bot commented Oct 25, 2023

Copy link
Copy Markdown

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
@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
Copy Markdown
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
Copy Markdown
Contributor

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

@mtrezza

mtrezza commented Oct 30, 2023

Copy link
Copy Markdown
Member Author

This is a Cloud Code only feature.

@oallouch

Copy link
Copy Markdown
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

mtrezza commented Oct 30, 2023

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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