I'm hosting RavenDB in my local IIS. It works like a charm.

Any idea what I am missing here though in testing the HTTP API? Using a browser, my call to http://localhost/RavenDB/databases/[databasename]/docs/Users/[id] returns the expected json result for the request.

However, I've found that a call to http://localhost/RavenDB/databases/[databasename]/docs/Users returns nothing! should it not be returning the collection of all user documents?

有帮助吗?

解决方案

No. The URL format is: http://localhost/RavenDB/databases/{database-name}/docs/{doc-id}, so in your case you specified an id of a document that is not exist. In this case you should get 404.

To elaborate on this even more, RavenDB doesn't have the concept of collection. In the studio we show you the documents with the save "Raven-Entity-Name" attribute under the same collection, but this is it, there is no really collections that you can query on. If you need to achieve something similar, you can query the Raven/DocumentsByEntityName index, like:

http://localhost:8080/databases/{db-name}/indexes/Raven/DocumentsByEntityName?query=Tag%253A%2520{{Raven-Entity-Name}}&start=0&pageSize=128&aggregation=None

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top