You are currently browsing legacy 3.0 version of documentation. Click here to switch to the newest 5.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Commands: StartsWithAsync

StartsWithAsync can be used to retrieve multiple file headers for the specified prefix name.


Task<FileHeader[]> StartsWithAsync(string prefix, string matches, int start, int pageSize);
prefix string The prefix that the returned files need to match
matches string Pipe ('|') separated values for which file name (after 'prefix') should be matched ('?' any single character; '*' any characters)
start int The number of files that should be skipped
pageSize int The maximum number of the file headers that will be returned

Return Value
Task<FileHeader[]> A task that represents the asynchronous operation. The task result is the array of FileHeaders.

Example I

The below code will return 128 results at most for files which names start with /images.

FileHeader[] images = await store
	.StartsWithAsync("/images", null, 0, 128);

Example II

In contrast to the previous example, here only the images which names end with .jpg will be returned.

FileHeader[] jpgs = await store
	.StartsWithAsync("/images", "*.jpg", 0, 128);