How to write wildcard search query in couchdb where name like 'a%'

Arun M R Nair

How can I write wildcard search in couchdb? I want to write query same as 'LIKE %' in sql.please help me for this.

 {
"name":"arun",
"surname":"mr"
}

 {
"name":"balu",
"surname":"tp"
}

I need to list all names that start with 'a'.

Thanks..

Akshat Jiwan Sharma

In couchdb you can query over string ranges.

First you need to have a view that emits all the names as keys

function(doc){
  if(doc.name)
  emit(doc.name,null);
}

Then you can query it with

http://localhost:5984/your-db-name/_design/your-ddoc-name/_view/your-view-name?startkey="a"&endkey="a\ufff0" which will give you all the names starting with a.

'\uff0' is just a high value unicode character, not a specific character that will perform magic tricks in couchdb.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to query a table with wildcard in the name

From Dev

CouchDB: how to use wildcard

From Dev

Write query for couchDB

From Dev

Write query for couchDB

From Dev

numerical wildcard in LIKE query?

From Dev

numerical wildcard in LIKE query?

From Dev

Rails where fields concatenated like search query

From Dev

How to write codeigniter like query

From Dev

How to write complicated query like this?

From Java

How to write a conditional in a search query?

From Dev

how to write a search query in SQL

From Dev

How to use Spring JPA query name convention to query wildcard

From Dev

How to write like mysql query which include result starting from search "keyword"?

From Dev

How to do a SQL query using a string wildcard and LIKE?

From Dev

Using codeigniter like query with wildcard

From Dev

MySql Query in Python LIKE with Wildcard

From Dev

How to add wildcard query in Hibernate Search 3.1.1GA

From Dev

How to Wrap WildCard before search criteria in meta_query wordpress?

From Dev

SELECT ... WHERE ... query in CouchDB + Python

From Dev

How to search for a substring (WHERE column LIKE '%foo%')

From Dev

how to write query like this table structor?

From Dev

Mongoose Query Where Clause with Wildcard

From Dev

how to parse a search query string like SO

From Dev

query search LIKE use keywords where and left join LARAVEL 5

From Dev

Wildcard column name in UPDATE query

From Dev

How to order query for searching where value = or is LIKE

From Dev

How to write search query in sql server

From Dev

Elastic search wildcard query working by text query not

From Dev

CodeIgniter "like()" function with % wildcard inside search terms

Related Related

HotTag

Archive