Does DocumentDB support the LIKE keyword in queries?
The keyword for LIKE
is CONTAINS
. If you had a document with a firstName
property and you wanted to filter on the name 'bob'
you would use it in a query this way:
"SELECT * FROM c WHERE CONTAINS(c.firstName, 'bob')"
Or if you were using Linq
and assuming you had a class Person
with a FirstName
property the same query would work this way:
var dbClient = GetClient(); var docs = dbClient.CreateDocumentQuery<Person>(Collection) .Where(p => p.FirstName.Contains("bob");