私は、デフォルトの制限値を変更することができ、同じ問題に対抗し、CouchDBの2.1では再帰関数で
const batchSize = 25;
let batchCount = 0;
let searchResults = [];
// in my case I want to find docs with a certain date, hardcoded here as example
let selectedDate = '2017/10/30';
// the recursive function
let search = function (count, limit){
return db.find({
selector: {
date: selectedDate
},
limit: batchSize,
skip: batchCount*batchSize
}).then(function(batch){
if (batch.docs.length === 0){
// there are no (more) search results, so we can return what we have
return searchResults
} else {
// there may be more search results, so we add this batch to the result and call the function again to ask more. We increase the counter so that the first batch(es) are skipped
for (var i = 0; i < batch.docs.length; i++) {
searchResults.push(batch.docs[i])
}
batchCount ++
return search(batchCount, batchSize)
}
})
}
search(batchCount, batchSize).then(function(result){
// you can handle the searchresults
})
を、それを解決しました。したがって、私はあなたがこの制限を回避できるとは思わない。とにかく、あなたが結果を持っているほど、処理され、httpで送信するのに時間がかかるので、制限があります。要求のページングを処理するコードを常に設計する必要があります。 –
@AlexisCôtéありがとうAlexis !! :)この時点では、より良い選択肢であるように見えるので、ページ区切りのアプローチを使用します。 –
私の悪い、ページネーションはまだサポートされていません(それは次のリリースの一部になるようです)、私は一時的に限界のために高い数を置くことができると思います。 –