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

Add missing mingo array operators #4203

Merged
merged 1 commit into from
Dec 30, 2022
Merged

Add missing mingo array operators #4203

merged 1 commit into from
Dec 30, 2022

Conversation

swnf
Copy link
Contributor

@swnf swnf commented Dec 29, 2022

This PR contains:

  • IMPROVED TESTS
  • A BUGFIX

Describe the problem you have without this PR

The $elemMatch operator did not work for me after upgrading to 13.17.0. It seems like the array operators $elemMatch, $all and $size are not enabled in mingo anymore. But they are part of the RxQuery type definition:

$all?: T[];
$size?: number;
$elemMatch?: RxQueryOptions<T>;

This PR enables them and adds a corresponding test.

@pubkey
Copy link
Owner

pubkey commented Dec 29, 2022

Hi @swnf
Thank you for the PR.
The goal for this was to unify which operators work and which do not work across all RxStorage implementations.
Of course most stuff does not work on PouchDB which is deprecated anyway and will be removed.

However if an operator does not work on the lokijs storage, I will not add it to RxDB.

I think we should first merge the $elemMatch and $size.
But for $all, we need to first find a workaround to make it work with lokijs.

@swnf
Copy link
Contributor Author

swnf commented Dec 30, 2022

I removed $all from this PR. If you want consistent support, it might make sense to just drop support for $all and remove it from the RxQuery type definition in RxDB 14. I think it is just a fancy way to write $and (see here).

pubkey added a commit that referenced this pull request Dec 30, 2022
@pubkey
Copy link
Owner

pubkey commented Dec 30, 2022

I removed $all from the types 9d669c1

Strange that the CI fails, @SebasG22 can you check?

@SebasG22
Copy link
Contributor

I removed $all from the types 9d669c1

Strange that the CI fails, @SebasG22 can you check?

Looks like it's some wired behavior, can you retry the job for this one and see if that works?
Could be related to a timeout issue that the element does not exist when the test started...
If this is repetitive I can take a deep look, because the changes in the PR are not related to the example at all.

@pubkey
Copy link
Owner

pubkey commented Dec 30, 2022

@SebasG22 I fixed it by pinning the vite versions 8387dbd

@pubkey pubkey merged commit edd406b into pubkey:master Dec 30, 2022
pubkey added a commit that referenced this pull request Dec 30, 2022
pubkey added a commit that referenced this pull request Dec 30, 2022
* REFACTOR utils

* REMOVE $all query type #4203

* Update package.json

* Add missing mingo array operators (#4203)

* ADD #4203 to changelog

* Update dependency babel-loader to v8.3.0 (#4206)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency @types/node to v14.18.36 (#4207)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency apollo-server-express to v3.11.1 (#4205)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* 13.17.1

* Update dependency firebase to v9.15.0 (#4210)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency concurrently to v7.6.0 (#4208)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* REFACTOR use plain functions for replication plugins

* FIX docs

* FIX stuff

* FIX stuff

* FIX build

* TRY fix types

* FIX types

* FIX graphql example

* FIX

* FIX import

Co-authored-by: swnf <50806201+swnf@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
pubkey added a commit that referenced this pull request Jan 1, 2023
* CHANGE Do not use hash for revisions

* Remove the deprecated PouchDB RxStorage

* REMOVE pouchdb RxStorage

* FIX typing tests

* FIX imports

* FIX ci

* FIX imports

* FIX tests

* FIX imports

* REMOVe pouchdb from tests

* REMOVE pouchdb scripts

* FIX imports

* FIX import

* FIX tests

* FIX tests

* FIX tests

* FIX lokijs tests

* CHANGE (memory RxStorage) do not clean up database state on closing of the storage, only on `remove()`

* FIX node example

* FIX ci

* FIX stuff

* FIX ci

* FIX foundationdb stuff

* FIX stuff

* FIX test

* FIX t est

* FIX stuff

* REMOVE old `replication-couchdb` plugin. Rename `replication-couchdb-new` to `replication-couchdb`.

* FIX angular replication

* FIX websocket replication

* FIX type

* FIX stuff

* FIX import

* UPDATE stuff

* FIX CouchDB replication: Use correct default fetch method

* FIX vue

* FIX stuff

* FIX stuff

* FIX ci

* FIX vue

* FIX ciu

* aDD log to debug

* FIX stuff

* FIX tests

* CHANGE use plain json errors inside of RxError parameters to make debugging easier.

* FIX tests

* REFACTOR error handling of RxStorageInstance.bulkWrite()

* FIX types

* FIX error

* FIX test

* ADD incremental write queue (#4186)

* ADD incremental write queue

* RMEOVE logs

* FIX types

* Remove depricated `skipIfSame` from `putAttachment()`

* CHANGE immutable documents (#4189)

* CHANGE immutable documents step1

* FIX tests

* FIX more tests

* FIX more tests

* FIX more tests

* FIX more tests

* FIX tests

* FIX tests

* FIX docs

* FIX tests

* FIX tests

* ADD changelog

* FIX tests

* FIX types

* FIX deps

* UPDATE typescript

* UPDATE angular

* UPDATE typescript

* FIX typos

* UPDATE node

* FIX angular

* UPDATE @types/node

* REMOVE unmaintained babel-plugin-transform-async-to-promises

* FIX angular tests

* FIX babel confict

* ADD changelog

* REMOVE comment

* UPDATE testcafe

* TRY fix tests

* FIX run headless

* TRY fix stuff

* TRY ajax timeout

* IMPROVE error log

* FIX stuff

* FIX closing of replication

* FIX todos

* CHANGE `RxCollection.findByIds()` now returns a `RxQuery` (#4191)

* CHANGE `RxCollection.findByIds()` now returns a `RxQuery`

* ADD orga

* FIX do not return deleted documents

* FIX schema hashing should respect the sort order #4005

* FIX lint

* CHANGE Prefix storage plugins with `storage-` like `rxdb/plugins/stor… (#4193)

* CHANGE Prefix storage plugins with `storage-` like `rxdb/plugins/storage-dexie`

* FIX remove more PouchDB stuff

* FIX build

* FIX imports

* FIX types

* FIX imports

* FIX clear cache

* FIX clear cache

* FIX supabase example

* FIX document cache to work with QuickJS

* CHANGE prefix ci task names

* FIX flutter

* FIX tests

* FIX types

* REMOVE more pouchdb specific tests

* REMOVE more pouchdb specific tests

* FIX test

* RENAME atomic->incremental (#4197)

* RENAME atomic->incremental

* ADD more incremental methods

* FIX run hooks on remove

* FIX format

* ADD typings to the query selector

* UPDATE orga

* FIX build

* FIX stuff

* FIX mingo

* FIX circular deps

* TRY fix import

* ADD notes

* REFACTOR utils (#4204)

* REFACTOR utils

* REMOVE $all query type #4203

* Update package.json

* Add missing mingo array operators (#4203)

* ADD #4203 to changelog

* Update dependency babel-loader to v8.3.0 (#4206)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency @types/node to v14.18.36 (#4207)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency apollo-server-express to v3.11.1 (#4205)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* 13.17.1

* Update dependency firebase to v9.15.0 (#4210)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency concurrently to v7.6.0 (#4208)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* REFACTOR use plain functions for replication plugins

* FIX docs

* FIX stuff

* FIX stuff

* FIX build

* TRY fix types

* FIX types

* FIX graphql example

* FIX

* FIX import

Co-authored-by: swnf <50806201+swnf@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* FIX ci

Co-authored-by: swnf <50806201+swnf@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

None yet

3 participants