pouchdb-find, $or and multiple $regex conditions and nested properties
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
### Issue
using `pouchdb-find` with the selector of `$or` array and multiple `$regex` conditions throws an error in the console. it seems that `$and` and multiple `$regex` works fine since this [commit](https://github.com/pouchdb/pouchdb/commit/0e27e23f4437bce134d0780a543f08a3020fa4de) has been merged.
### Info
- Environment: browser/hybrid app
- Platform: Chrome/iOS/Android
- Adapter: indexeddb
- Server: no server, PouchDB client.
### Reproduce
1. data downloaded and saved in PouchDB.
2. database index created with fields: `from.name` and `type`.
3. by running the code below, the error console which is attached will appear in the console. using `$and` works tho.
```js
db.find({
selector: {
{
$or: [
{"from.name": {$regex: /foo/i}},
{type: {$regex: /bar/i}},
]
}
}
});
```

Contributor guide
Assessment
This issue has not been assessed yet.