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

Adding support for arrayFilters in updates #4248

Merged
merged 10 commits into from
Jan 26, 2022

Conversation

joellord
Copy link
Contributor

@joellord joellord commented Jan 24, 2022

What, How & Why?

This PR is for the feature request #4247.

This PR adds support for arrayFilters by passing the arrayFilters parameter to the Realm serverless function.

Additional testing was added to cover the case of an update with arrayFilters.

This closes #4247

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 🚦 Tests
  • 📱 Check the React Native/other sample apps work if necessary
  • 📝 Public documentation PR created or is not necessary
  • 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • typescript definitions file is updated
  • jsdoc files updated
  • Chrome debug API is updated if API is available on React Native

This PR is for the feature request [realm#4247](realm#4247).

This PR adds support for arrayFilters by passing the arrayFilters parameter to the Realm serverless function.

Additional testing was added to cover the case of an update with arrayFilters.
@cla-bot cla-bot bot added the cla: yes label Jan 24, 2022
@kneth
Copy link
Contributor

kneth commented Jan 24, 2022

@joellord I have initiated CI on your PR, and I will report back the result.

@kneth
Copy link
Contributor

kneth commented Jan 24, 2022

We see a few linting errors:

Screenshot 2022-01-24 at 14 12 55

@joellord
Copy link
Contributor Author

Fixed the linting errors.

@joellord
Copy link
Contributor Author

I see that there is a test that fails, but I'm quite confused as to how to go to fix it. It seems like the test runner didn't have the credentials for docker.

@kraenhansen
Copy link
Member

I did a new PR with your changes (to allow our integration tests to run) and got this result: https://github.com/realm/realm-js/runs/4950056552?check_suite_focus=true

1) App services
     Remote MongoDB
       can update documents using array filters:
   Error: Request failed (POST http://localhost:8080/api/client/v2.0/app/my-test-app-amkmy/functions/call): mongodb insert: "document" argument must be a object (status 400 Bad Request)
      at Function.fromRequestAndResponse (webpack-internal:///../realm-web/dist/bundle.dom.es.js:2868:24)
      at async Fetcher.fetch (webpack-internal:///../realm-web/dist/bundle.dom.es.js:3031:23)
      at async Fetcher.fetchJSON (webpack-internal:///../realm-web/dist/bundle.dom.es.js:3048:26)
      at async Context.eval (webpack-internal:///./src/remote-mongodb-service.test.ts:266:30)

@kraenhansen
Copy link
Member

Now that #4265 is green, I believe its safe to merge.
Thanks a lot for the PR!

@kraenhansen kraenhansen merged commit 03621d2 into realm:master Jan 26, 2022
@jasontlouro
Copy link

Thank you @joellord! I just spent the morning working on array identifiers in MongoDB Realm only to realize that they don't work on realm-web (was running 1.4.0). Luckily found this and realized you built it into the latest version! You saved the day.

takameyer pushed a commit that referenced this pull request Feb 9, 2022
* Adding support for arrayFilters in updates

This PR is for the feature request [#4247](#4247).

This PR adds support for arrayFilters by passing the arrayFilters parameter to the Realm serverless function.

Additional testing was added to cover the case of an update with arrayFilters.

* Fix linting errors

* Reverted change in package.json that caused tests to fail

* Fixing the test to insert a single item

* Update CHANGELOG.md

* Update CHANGELOG.md

* Trying to get those tests to pass

* Update remote-mongodb-service.test.ts

Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Kræn Hansen <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for arrayFilters updates in the realm-web package
4 participants