You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pouchdb.apache.org by "henyanagar (via GitHub)" <gi...@apache.org> on 2026/06/14 14:39:19 UTC
[PR] Fix elemMatch null object array handling [pouchdb]
henyanagar opened a new pull request, #9257:
URL: https://github.com/apache/pouchdb/pull/9257
Title:
Fix elemMatch with null elements in object arrays
Body:
Fixes #9103
### Summary
This updates `$elemMatch` handling for arrays that contain both objects and `null` values.
Previously, `$elemMatch` decided whether to use `rowFilter()` based only on the first array element. If the first element was an object, later `null` entries were still passed into `rowFilter()`, which could throw a TypeError when resolving nested fields.
The updated logic checks each array element before applying object-field matching, so `null` entries are ignored for object-field `$elemMatch` selectors instead of throwing.
### Testing
* Added a regression test for `$elemMatch` with an object array containing `null`.
* Verified the new test fails before the fix with:
`TypeError: Cannot read properties of null`
* Verified after the fix:
`1 passing`
* Verified the full elem-match test file:
`7 passing`
* Ran ESLint on the changed source and test files.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pouchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix elemMatch null object array handling [pouchdb]
Posted by "janl (via GitHub)" <gi...@apache.org>.
janl commented on PR #9257:
URL: https://github.com/apache/pouchdb/pull/9257#issuecomment-4729035409
Hi, thank you for your contribution. Would you be able to use our pull request template, so we can process your submission according to our guidelines? Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pouchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org