pouchdb
pouchdb copied to clipboard
$or with $regex broken after 7.2.2 -> 7.3.0
Issue
BugFix 0e27e23f (#8222) - fix multiple $regex conditions on same field when using $and
has implement error with $or and $regex
Error => userValue.every is not a function
in
'$regex': function (doc, userValue, parsedField, docFieldValue) {
return fieldExists(docFieldValue) &&
typeof docFieldValue == "string" &&
userValue.every(function (regexValue) {
return regexMatch(docFieldValue, regexValue);
});
},
with Selector
{
"$and": [
{
"$or": [
{
"field1": {
"$regex": "/searchtext/i"
}
},
{
"field2": {
"$regex": "/searchtext/i"
}
},
{
"field3": {
"$regex": "/searchtext/i"
}
},
{
"field4": {
"$regex": "/searchtext/i"
}
}
]
},
{
"fieldA": {
"$exists": true
},
"fieldB": {
"$exists": true
}
}
]
}
Info
- Environment: Browser
- Platform: all
- Adapter: indexeddb
- Server: CouchDB
Reproduce
see up
I have the fix ready for this. I need to write the unit tests and send the PR.
@filionf looks like there was a build error on your PR. Is this something that can be sorted - seems simple enough as it's largely a linting error
From what I can see, the latest build went through. What seems to be missing is a reviewer. https://github.com/pouchdb/pouchdb/pull/8493
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
This is still an issue. #8493 needs to be merged.
Fix merged.
When new version will be available ?
When this fix will be available ?
@garethbowen do we have an ETA for when this can be released.
Even if we get a patch out for it?
I'm not planning a release. I suggest reaching out on Slack.
@garethbowen ok. I cant seem to find details of the slack channel. Is that something you can post at all ?
@pete-hotchkiss Good point... Join the couchdb Slack here: https://join.slack.com/t/couchdb/shared_invite/zt-fa9zim0j-H04m4o_KcLdWeOxEAcwM8g
Then there's a #pouchdb
channel. The community is more active there than here.
The pouchdb website should also be updated to include this info...
This has been released now, thanks for the heads-up: https://pouchdb.com/2022/11/11/pouchdb-7.3.1.html
Why is the fix not in the release? => https://pouchdb.com/2022/11/11/pouchdb-7.3.1.html
@JanGoerss is it perhaps just a case of it not making the release notes. Personally - I haven't had a chance to run any tests yet to tell.
But from what I can tell - the code for the fix is in the main/master branch
Its the same error in 7.3.1 -> userValue.every is not a function It's definitely not in release or it's not really fixed.
From what I can tell, this PR has not been integrated into the 7.3.x branch. I installed a few 7.3.1 versions on my local environment and could not find the modifications that this PR brings.