couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Metson <>
Subject Re: Document filter and sorting
Date Tue, 07 Aug 2012 09:14:46 GMT
To do the table sort I'd use client side javascript (for example (
Depending on the size of your dataset that might be sufficient to do the filtering, too. 

If you have a really large dataset (e.g. one that can't entirely be sent to the client) you
can make the view keyed by city (you might want to have a key that's [Country, State, City],
since there are cities that have the same name) and then query the list function (and corresponding
view) with ?key="The City" (or key=["The country", "The state", "The city"] if you go with
a complex key). 

Hope that helps

On Tuesday, 7 August 2012 at 05:40, Mobashir Hasan wrote:

> Hi,
> I'm new to couchdb and have stuck badly, I have a listing page where I display the documents
that has some specific values.Now what I have to do is to filter these document by different
user inputs and sorting the documents by different columns.I have 6 columns in my documents.Date
to, Date from, Name, City, State, Country, Zip
> when user inputs city and hit filter so it should display documents of that city only.Similarly,
when user click on column name "City" it should sort / asc / desc.
> Work environment is JavaScript / html only.
> Any help will be highly appreciated.
> Thanks,Mobashir 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message