让我们假设我们在PouchDB中存储表示为JSON对象的汽车(大约40MB),我们希望根据马力属性进行搜索.sql中的示例:select*from HP> 100的汽车.
您可以按键查询pouchDB,但显然HP不是文档的关键.有没有办法可以做到这一点?
据我了解地图功能,
function(doc) {
if(doc.value) {
emit(doc.value, null);
}
}
Run Code Online (Sandbox Code Playgroud)
无法访问函数外部范围内的任何变量.
var horsePower = $scope.horsePowerInputField
function(doc) {
if(doc.hp > horsePower) {
emit(doc.value, null);
}
}
Run Code Online (Sandbox Code Playgroud)
那么有可能查询数据库,基于非关键变量进行参数化吗?
pouchdb ×1