You are currently browsing legacy 4.0 version of documentation. Click here to switch to the newest 5.1 version.
Session: Querying: How to Use Regex
To return only documents that match regular expression, use the
regex method which enables RavenDB to perform server-side pattern matching queries.
The supplied regular expression must be .NET compatible.
// loads all products, which name // starts with 'N' or 'A' List<Product> products = session.query(Product.class) .whereRegex("Name", "^[NA]") .toList();
from Products where regex(Name, '^[NA]')