On Mon, Dec 6, 2010 at 1:32 PM, Matthew Woodward <[email protected]>wrote:
> Is there a way to pass a specific last name as the key in the URL and have
> the results be the example I gave in my previous message, but only for the
> specific last name provided as the key?
>
Sorry, keep thinking of better ways to explain this.
If I use a specific value for the regex in a match function, it works fine,
but I'd like to use the key in the URL as the value against which to match.
For example here's the map function:
"map":"function(doc) {
var lastNameMatch = doc['lastName'].match(/Woodward/);
if (lastNameMatch) {
emit([doc.lastName, doc.firstName, doc.middleInitial], null);
}
}"
So what I'd like to be able to do is include key="Woodward" in the URL and
have the value of the key in the URL be what's used in my match regex, or if
there's a different way to do exact matches (because in this case I will
always be pulling by exact key matches) and still have the rest of this work
as described before, that's fine as well.
--
Matthew Woodward
[email protected]
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward
Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html