You'll need to emit the last name first so that the items with the
same last name sort together.
function(doc) {
emit([doc.lastname, doc.firstname], null);
}
and then query with ?startkey=["Afzali"]&endkey=["Afzali",{}]
more simply;
function(doc) {
emit(doc.lastname, null);
}
and then query with ?key="Afzali"
B.
On Thu, Jul 1, 2010 at 10:29 PM, afshin afzali <[email protected]> wrote:
> Sorry, But I don't know why list rejects my post!!!
>
> Ok, assume we have three object keys which emited by a view;
>
> { "FirstName" : "Afshin", "LastName" : "Afzali" }
> { "FirstName" : "Omid", "LastName" : "Afzali" }
> { "FirstName" : "Ashkan", "LastName" : "Afzali" }
>
> I want to retreive all docs which have LastName == "Afzali"
> -- afshin
>