Reputation: 197
I would like to order a Cloudant view by date in descending order, and I'm new to NoSQL and I have no ideia how.
This is what I have so far:
function(doc){
if(doc['type'] == 'DOCUMENT' && doc.date){
emit(doc.date);
}
}
Upvotes: 0
Views: 426
Reputation: 390
When doing your query, specify descending=true
curl "https://$ACCOUNT.cloudant.com/$DATABASE/_design/$DDOC/_view/view_name? descending=true" \
-H "Content-Type: application/json"
Upvotes: 0