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

Case insensitive regex queries #538

Closed
muety opened this issue May 13, 2021 · 2 comments
Closed

Case insensitive regex queries #538

muety opened this issue May 13, 2021 · 2 comments

Comments

@muety
Copy link

muety commented May 13, 2021

I'm using Kivik to access a database running on the latest version of pouchdb-server. I'd like to be able to run case-insensitive regex queries. Consider this example:

rows, err := s.db.Find(context.TODO(), map[string]interface{}{
    "selector": map[string]interface{}{
        "title": map[string]interface{}{
	     "$regex": "Bar",
        },
    },
})

Having a document with { "title": "Foo Bar Baz" }, the above query will succeed and return the document. However, I'd still like to find it if my regex was bar (lower case).

Using (?i)bar as a regex yield the following error:

Bad Request: Invalid regular expression: /(?i)bar/: Invalid group

Edit: I assume this might instead be an issue with PouchDB itself, rather than with Kivik?

@flimzy
Copy link
Member

flimzy commented May 13, 2021

This does look like something from PouchDB-server. Kivik should just pass that string unprocessed, to the server directly. So any error that comes from parsing that string must come from the server.

@muety
Copy link
Author

muety commented May 13, 2021

Thanks for the quick reply! I filed an issue upstream (pouchdb/pouchdb-server#445). Let's see what happens.

@muety muety closed this as completed May 13, 2021
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

No branches or pull requests

2 participants