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

Add example to show how to use db.View #5

Open
zyfdegh opened this issue Jan 5, 2017 · 2 comments
Open

Add example to show how to use db.View #5

zyfdegh opened this issue Jan 5, 2017 · 2 comments

Comments

@zyfdegh
Copy link

zyfdegh commented Jan 5, 2017

Well, I got stuck to use db.View() to query filtered data from CouchDB. I have carefully looked up view_test.go but I'm confused about the _design database. Is the possible to query filtered data without setting _design/* database? Could you(or anyone) please add an example under example/ directory to show how to use it?

@zyfdegh
Copy link
Author

zyfdegh commented Jan 5, 2017

The question can be simplified as following

  1. I save the following data to database user,
{"username" : "admin","password" : "$2y$05$hvbfzxywSeQjlF28XpLQCeiHZpTkO7od9xmKtki2XGTNkG0njtI6q"}
{"username" : "user2","password" : "$2y$05$H/7thIYBrgl/c3P3Mjmm5u6Y/xuXAwnNRfLI6ib50/7C41fOhpxOG"}
  1. I want to query the document where username==admin from the database. If any doc matches, I will compare the password.

Then, how?

@zemirco
Copy link
Owner

zemirco commented Mar 19, 2017

That sounds more like a general question about querying CouchDB. The question is not directly related to this library. Please try http:https://stackoverflow.com/questions/tagged/couchdb.

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