0

Could someone point me to an example of a Couchapp application that queries a view with a key based on user input from an HTML form?

I can't seem to either figure out how to do this or find an example on my own via google.

Jason S
  • 184,598
  • 164
  • 608
  • 970

1 Answers1

2

I figured it out:

If you're using evently, then in /evently/[whatever]/_changes, instead of a fixed query.json, you can replace it with a query.js where you can dynamically return a query, e.g.:

function() {
  var key = /* ... */
  // get your key from the appropriate source (jquery, current page's URL, etc) 
  return {
    "view" : "recent-items",
    "key" : key,
    "limit" : 50
  }
}
Jason S
  • 184,598
  • 164
  • 608
  • 970