Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 RavenDb 4 中为特定数据库添加索引。我看到了函数
new SearchableIndex().Execute(_documentStore);
new SearchableIndex().Execute(_documentStore)
如何指定数据库,而不将默认数据库设置为文档存储初始化的一部分。我希望将数据库名称作为参数传递。
您为DocumentStore使用Database属性设置数据库。初始化时,这样做:
DocumentStore
Database
var _documentStore = new DocumentStore { Urls = new[] { "http://localhost:8080" }, Database = "databaseName" }; new SearchableIndex().Execute(_documentStore);