使用选择器进行 CouchDB 复制
尝试使用选择器创建 CouchDB 复制 [1]: https://i.sstatic.net/d3XzH.png 但请求返回错误“未知的内置过滤器名称”。
请求 URL 为 'https://example.com/schemes/_changes?timeout=25000&style=all_docs&filter=_selector%2F_selector&since=0&limit=4'
为什么选择器在要求?
public startReplication = async (): Promise<void> => {
this.database.sync(null, {
pull: {
live: true,
retry: true,
filter: undefined,
selector: {
selector: {
author: '456w346456',
},
sort: ['modified', 'asc'],
fields: ['firstField', 'secondField']
},
batch_size: 4
},
push: {
live: true,
retry: true,
},
});
};
Trying to create CouchDB replication using a selector
[1]: https://i.sstatic.net/d3XzH.png
but the request returns an error "unknown builtin filter name".
Request URL is 'https://example.com/schemes/_changes?timeout=25000&style=all_docs&filter=_selector%2F_selector&since=0&limit=4'
Why is the selector duplicated (_selector%2F_selector) in the request?
public startReplication = async (): Promise<void> => {
this.database.sync(null, {
pull: {
live: true,
retry: true,
filter: undefined,
selector: {
selector: {
author: '456w346456',
},
sort: ['modified', 'asc'],
fields: ['firstField', 'secondField']
},
batch_size: 4
},
push: {
live: true,
retry: true,
},
});
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想要类似的东西:
选择器
应该只是一个描述要应用于更改提要中的每个更改的查询的对象。在您的示例中,选择器内有一个嵌套的selector
对象。此外,您的
sort
和fields
键在这里无关紧要:它不像查询机制 - 您无法指定排序顺序或要返回哪些字段。You probably want something like:
The
selector
should just be an object describing the query that is to be applied to each change in the changes feed. In your example, you have a nestedselector
object within the selector.Also your
sort
andfields
keys are irrelevant here: it's not like the querying mechanism - you can't specify the sort order or which fields are to be returned.