Couchbase Lite:无法在此处访问内部构造函数 "Document"
Couchbase Lite: Cannot access internal constructor "Document" here
我正在尝试在 Xamarin.Forms 应用程序中使用 Couchbase Lite 2.0(开发人员预览 #21)。我的代码共享项目是一个 .NET Standard 2.0 应用程序。
所以我正在关注有关此开发人员预览版的文档。我的问题是当我尝试创建一个 new Document 对象时。此时 IDE 表示我 Cannot access the internal constructor "Document" here
.
var db = new Database("test");
var document = new Document(); // error raised in this line
但这是文档指示创建新文档对象的方式。我做错了什么?
谢谢。
来自 Couchbase Forum 上的一个问题:
The API changed a few DBs back to switch to an immutable first
paradigm. So now things have a “Mutable” counterpart that you can
mutate. In this case the class you want is MutableDocument. For what
it’s worth this is all mentioned in the release notes. If the release
notes are hard to find, though, then that is another story.
即:
使用 Couchbase Lite 2.0 时,您应该实例化 MutableDocument
而不是 Document
。
我正在尝试在 Xamarin.Forms 应用程序中使用 Couchbase Lite 2.0(开发人员预览 #21)。我的代码共享项目是一个 .NET Standard 2.0 应用程序。
所以我正在关注有关此开发人员预览版的文档。我的问题是当我尝试创建一个 new Document 对象时。此时 IDE 表示我 Cannot access the internal constructor "Document" here
.
var db = new Database("test");
var document = new Document(); // error raised in this line
但这是文档指示创建新文档对象的方式。我做错了什么?
谢谢。
来自 Couchbase Forum 上的一个问题:
The API changed a few DBs back to switch to an immutable first paradigm. So now things have a “Mutable” counterpart that you can mutate. In this case the class you want is MutableDocument. For what it’s worth this is all mentioned in the release notes. If the release notes are hard to find, though, then that is another story.
即:
使用 Couchbase Lite 2.0 时,您应该实例化 MutableDocument
而不是 Document
。