You are currently browsing legacy 3.5 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Commands: Querying: How to stream query results?

Use StreamQuery method to stream results of a selected index according to a specified query.


IEnumerator<RavenJObject> StreamQuery(
	string index,
	IndexQuery query,
	out QueryHeaderInformation queryHeaderInfo);
index string A name of an index to query
query IndexQuery A query definition containing all information required to query a specified index.
queryHeaderInfo QueryHeaderInformation Information about performed query
Return Value
IEnumerator<RavenJObject> Enumerator with query results
QueryHeaderInformation Information about performed query


QueryHeaderInformation queryHeaderInfo;
IEnumerator<RavenJObject> enumerator = store
		new IndexQuery
			Query = "Company:companies/1"
		out queryHeaderInfo);

while (enumerator.MoveNext())
	RavenJObject order = enumerator.Current;