Skip to content

Instantly share code, notes, and snippets.

@jvkumar
Created November 27, 2012 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvkumar/4156170 to your computer and use it in GitHub Desktop.
Save jvkumar/4156170 to your computer and use it in GitHub Desktop.
email template
template {
id: hash of (name,country,text,language,unixtimestamp)
name:
text:
html:
subject:
description:
country:
language:
is_active:
created_at:
modified_at:
}
Use validate_doc_update function (http://wiki.apache.org/couchdb/Document_Update_Validation) to check the uniqueness of (name,country,language,is_active)
Create, Edit and Delete Template
Template listing
@csm
Copy link

csm commented Nov 28, 2012

A view for this would be something like this:

{
    "query" : { "map": "function(doc) { emit([doc.country, doc.language, doc.is_active]); }" }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment