Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure table storage - how to create 'contains' condition

I want to query azure table storage not in default way, f.e.

conditions.Add(TableQuery.GenerateFilterCondition("UserRole", QueryComparisons.Equal, userRole));

I need some kind of QueryComparisons.Contains (as LIKE in SQL) that is not present by default.

What is the best way to implement this?

like image 1000
igorGIS Avatar asked Oct 14 '16 08:10

igorGIS


1 Answers

I need some kind of QueryComparisons.Contains (as LIKE in SQL) that is not present by default What is the best way to implement this? Thanks

As of today, it is not possible to implement a Contains kind of functionality with Azure Tables. You would need to fetch all entities and then do this operation on client side.

At best, you could do something like StartsWith with Azure Tables by using a combination of QueryComparisons.GreaterThanOrEqual and QueryComparisons.LessThan.

like image 109
Gaurav Mantri Avatar answered Oct 25 '22 17:10

Gaurav Mantri