在Nativescript中记录Couchbase查询结果
我不熟悉Nativescript和Couchbase,但在对我的Couchbase数据库执行查询时,我只想记录结果。下面是我的示例代码:在Nativescript中记录Couchbase查询结果,couchbase,nativescript,couchbase-lite,nativescript-angular,Couchbase,Nativescript,Couchbase Lite,Nativescript Angular,我不熟悉Nativescript和Couchbase,但在对我的Couchbase数据库执行查询时,我只想记录结果。下面是我的示例代码: let rows = this.database.executeQuery('profiles'); for(let i = 0; i < rows.length; i++) { this.profiles.push(rows[i]); } let rows=this.database.executeQuery('profiles'
let rows = this.database.executeQuery('profiles');
for(let i = 0; i < rows.length; i++) {
this.profiles.push(rows[i]);
}
let rows=this.database.executeQuery('profiles');
for(设i=0;i
当尝试使用console.log记录“行”时,我得到了预期的[Object]。我想我可以使用console.dir,但这样做时我得到:
JS:==dump():转储成员===
JS:“行:”
JS:==dump():转储函数和属性名称===
JS:0:r
JS:1:o
JS:2:w
JS:3:s
JS:4::
JS:5:
JS:6:
JS:==转储():已完成===
是否有办法记录executeQuery的实际结果?如果您愿意在收集行数组的结果后注销这些结果,您可以使用,并在数组上枚举。可能看起来像这样:
rows.forEach(row => {
console.log(JSON.stringify(row))
})
rows.forEach(row=>console.log(JSON.stringify(row)))
还是要实时执行?非常好,谢谢!