Skip to content

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

@HarounAns

Description

@HarounAns

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions