A very common use case for many applications is to expose data to users as an Excel file. RavenDB has dedicated support that allows you to directly consume data stored in a database by an Excel application.
The integration of Excel with the data store is achieved by a designated query streaming endpoint that outputs a stream in a format acceptable by Excel, Comma Separated Values (CSV).
In order to take advantage of this feature, you need to specify a valid query according to RQL syntax.
The generic HTTP request will have the following address:
Trying to use this url will throw the following error in excel
There are two ways to deal with this problem: You can use an online service like TinyUrl and provide them with the above url.
What you get back is a url like, https://tinyurl.com/y8t7j6r7. This is a pretty nice workaround if you're not on an isolated system and have no security restrictions.
The other option is to redirect the query through a pre-defined query that resides in your database.
For that you will need to include a document in your database with a Query property. Let's generate such a document and call it Excel/ProductWithCatagory.
The name of the document has no significance, but it is recommanded to use a key that reflects the purpose of this document.
Let's add the Query property and set its value to the above query: