【发布时间】:2019-11-26 14:35:03
【问题描述】:
我正在尝试在我的 xamarin 应用程序中将 couchbase 用于在线和离线数据库。 离线部分运行良好,但不同步。
我按照本教程进行操作: https://docs.couchbase.com/userprofile-couchbase-mobile/sync/userprofile/xamarin/userprofile_sync.html
我已经安装了 couchbase server ,我创建了一个名为 : userprofile 的存储桶和一个用户,并且我已经启用了 Application Access 和 Read Only Admin 角色。 我还安装了同步网关并配置了它, 这是我的配置 .json 文件
{
"log": ["*"],
"databases": {
"userprofile": {
"server": "http://127.0.0.1:8091",
"bucket": "user-profile",
"username": "Maria",
"password": "123456",
"enable_shared_bucket_access": true,
"import_docs": true,
"num_index_replicas": 0,
"delta_sync" :{"enabled":true},
"users": {
"Maria": { "password": "123456"},
"GUEST": { "disabled": false, "admin_channels": ["*"] }
},
"sync": `function (doc, oldDoc) {
if (doc.sdk) {
channel(doc.sdk);
}
}`
}
}
}
我使用这个命令来配置同步网关:
C:\Program Files\Couchbase\Sync Gateway\sync_gateway sync-gateway-config-userprofile-walrus.json
我也将同步 url 更改为 ws://10.0.2.2:4984,因为我使用的是 android 模拟器。 但它没有在设备之间同步,有人可以帮我吗?
【问题讨论】:
标签: c# xamarin synchronization couchbase couchbase-sync-gateway