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

CouchDB _find responses could have a warning key #139

Closed
fschndr opened this issue Jun 2, 2017 · 1 comment
Closed

CouchDB _find responses could have a warning key #139

fschndr opened this issue Jun 2, 2017 · 1 comment

Comments

@fschndr
Copy link

fschndr commented Jun 2, 2017

I recently messed around with _find and indexes. I accidentally produced a query with an miss matching index.
The error returned by ScanDoc() is Iterator is closed
Err() gives me Unexpected key: warning

I popped the query into my GUI REST client and the warning looks like this:

{
	"warning": "no matching index found, create an index to optimize query time",
	"docs": [
		{
...

For now this is the only warning in mango queries:
http:https://docs.couchdb.org/en/2.0.0/api/database/find.html#creating-selector-expressions

https://github.com/apache/couchdb/blob/f4c6113808d1809469df9c8be9d2f83ef399f064/src/mango/src/mango_httpd.erl#L235

I guess it would be good to expect possible warnings and let them surface anyhow. Maybe store them in a warning type - so you could retrieve it like Err().

Kind Regards

Fabian

@flimzy
Copy link
Member

flimzy commented Jun 3, 2017

Thank you for the bug report. I believe the problem is now solved. Please let me know if you discover otherwise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants