在 RxDB 中,要列出包含文档的远程数据库上的集合中的所有文档,我尝试过:
myCollection.dump()
.then(json => console.dir(json));
和
myCollection.find().exec() // <- find all documents
.then(documents => console.dir(documents));
来自文档:https ://rxdb.info/rx-collection.html#dump https://rxdb.info/rx-document.html#find
但两者都_find
用身体发帖:
{"selector":{"_id":{}}}
返回一个空的 docs [] 数组。_find
在 RxDB 之外执行的相同选择器也返回一个空的 docs 数组。
如果我使用 将文档添加到集合中myCollection.upsert()
,则文档将添加到远程服务器,然后在上述两个调用中显示为响应。但可能仅来自存储在内存中的内容,因为仍然有这个远程POST响应_find
为空。docs: []
因此,在页面刷新时,这些列表调用再次为空。
我正在使用:
"pouchdb-adapter-http": "7.0.0",
"rxdb": "8.0.4",
"rxjs": "6.3.3"