我按以下方式配置我的文档存储:
store = new DocumentStore { Url = serverUrl };
store.Initialize();
Run Code Online (Sandbox Code Playgroud)
我想知道如何确保先前或后期初始化但在打开会话之前是否客户端连接到服务器.我没有启动服务器,我仍然可以初始化存储,不知道为什么或者它是否默认创建嵌入式数据库,如果它无法在指定的URL下找到服务器.知道如何检查客户端和服务器之间是否建立了连接?
我已经将RavenDB 2.5.0安装为Windows服务.当我尝试以管理员身份运行Raven.Server.exe时,我会收到:
Trying to revoke rights for http.sys
runas netsh http delete urlacl url=https://+:8080/
Trying to grant rights for http.sys
runas netsh http add urlacl url=http://+:8080/ user="Endri-PC\Endri"
Failed to grant rights for listening to http, exit codes: (1 and 1)
A critical error occurred while starting the server. Please see the exception de
tails bellow for more details:
System.InvalidOperationException: Could not write to location: C:\RavenDB\Databa
se\System. Make sure you have read/write permissions for this path. ---> Microso
ft.Isam.Esent.Interop.EsentFileAccessDeniedException: Cannot access …Run Code Online (Sandbox Code Playgroud) 我编写了以下代码,在我的乌鸦数据库中为标题1添加标题字段.
url := "http://localhost:8083/databases/drone/docs/1"
fmt.Println("URL:>", url)
var jsonStr = []byte(`{"title":"Buy cheese and bread for breakfast."}`)
req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jsonStr))
req.Header.Set("X-Custom-Header", "myvalue")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println("response Body:", string(body))
Run Code Online (Sandbox Code Playgroud)
我不明白为什么它不起作用?我得到以下回应的身体,这不是我所期待的.我期待成功的回应.
<html>
<body>
<h1>Could not figure out what to do</h1>
<p>Your request didn't match anything that Raven knows to do, sorry...</p>
</body>
Run Code Online (Sandbox Code Playgroud)
有人可以指出我在上面的代码中缺少什么?
我们在服务器上部署了Raven,我们的.NET代码可以正常使用它.
当远程控制到盒子上时,我希望能够通过HTTP客户端对Raven进行HTTP调用.
我可以在Raven工作室看到我在一个名为'Locations'的集合中有一个文件,其ID为'locations/1'.Raven正在端口9999上运行,因此在我的HTTP客户端(Postman for Chrome)中,我输入以下GET请求:
http://localhost:9999/docs/locations/1
Run Code Online (Sandbox Code Playgroud)
但是,我总是得到404.
如果我使URL格式错误(例如,通过将'docs'段更改为'documents'),我会收到Raven的回复,告诉我它不知道如何处理请求,所以我必须在正确的位置.Raven似乎告诉我文件不在那里,当我知道它的时候.
有人能提供一些见解吗?
我想检测集合或索引的最后修改或写入时间。
注意:这在文档级别有效,但是我需要在集合/索引级别。如何通过C#获取RavenDB文档的最后写入日期