Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get a document with a specific field value in CouchDB?

Tags:

couchdb

I want to check if a document with a specific email exists.

How can I do that?

like image 433
ajsie Avatar asked Feb 02 '23 22:02

ajsie


1 Answers

You can create a view that has email as a key and query that view for the specific email address. Which values are appropriate for the view depends on what you're going to do with the results. You may, for example, choose the number of documents containing an email address as the values of the view.

This is a short introduction to views: http://wiki.apache.org/couchdb/Introduction_to_CouchDB_views

like image 115
titanoboa Avatar answered Feb 13 '23 22:02

titanoboa