0
如何從couchdb數據庫訂購結果,使用cradle作爲node.js?從the docs看來,將descending=true
參數添加到我的網址應該工作。我當前的代碼如下:在搖籃中訂購結果
this.db.view('articles/all',function(error, result) {
if(error){
callback(error)
}else{
var docs = [];
result.forEach(function (row){
docs.push(row);
});
callback(null, docs);
}
});
這些文章按日期排序(如下面我看來集)
function (doc) {
if (doc.created_at) emit(doc.created_at, doc);
}
如果我改變第一行
this.db.view('articles/all?descending=true',function(error, result) {
沒有結果將返回
那麼,如何訂購couchdb的搖籃?
謝謝!
你見過[this response](http://stackoverflow.com/questions/5573709/how-can-i-pass-parameters-to-a-view-using-cradle-couchdb/5578959#5578959)? – 2011-04-22 09:03:24