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

Query a couchdb view on whether the key contains the string #32

Open
HarounAns opened this issue Dec 7, 2017 · 0 comments
Open

Query a couchdb view on whether the key contains the string #32

HarounAns opened this issue Dec 7, 2017 · 0 comments

Comments

@HarounAns
Copy link

I am trying to do the following:

couch.get(dbName, viewURL, {
          "key" : "Extra. This is what I want to search for. Extra."
    }).then(function(data, status, headers){
       if(data.data.rows[0] === undefined){
         // nothing exists in the view by this key
       }
       else console.log(data.data.rows[0]) // gives first JSON element in db

    });

My question is if there is a way to query it so that the key only has to contain "This is what I want to search for." and doesnt care about the extra information. I realize that this is not the proper way that key:value pairs should be used, but I need it for a work around.

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

1 participant