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

Support for arrayFilters updates in the realm-web package #4247

Closed
joellord opened this issue Jan 24, 2022 · 1 comment · Fixed by #4248
Closed

Support for arrayFilters updates in the realm-web package #4247

joellord opened this issue Jan 24, 2022 · 1 comment · Fixed by #4248

Comments

@joellord
Copy link
Contributor

joellord commented Jan 24, 2022

Problem

As it current is, arrayFilters are not supported by the realm-web npm package. When passing an arrayFilters property in the third argument (options) as is expected when using the MongoDB Node.js driver, the following error message shows up.

No array filter found for identifier 'element' in path 'submissions.$[element].status'

The message hinted that the arrayFilters was not sent to the server. Looking at the POST request confirms that only the upsert option is passed to the serverless function on Realm. If the arrayFilters option is forced to the Realm function updateOne, the update works as expected.

Solution

PR to follow

How important is this improvement for you?

No response

joellord added a commit to joellord/realm-js that referenced this issue Jan 24, 2022
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.
@kneth
Copy link
Contributor

kneth commented Jan 24, 2022

@joellord I suggest that we keep the conversation in the PR and not here.

kraenhansen pushed a commit that referenced this issue Jan 26, 2022
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.
kraenhansen pushed a commit that referenced this issue Jan 26, 2022
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.
kraenhansen added a commit that referenced this issue Jan 26, 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]>
takameyer pushed a commit that referenced this issue 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 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants