Start a new topic

KCSUser query by regex

Regex Queries on UserId are not working. I am trying to fetch users the following way for a search.


 let store = KCSLinkedAppdataStore.storeWithOptions([
 KCSStoreKeyCollectionName : KCSUserCollectionName,
 KCSStoreKeyCollectionTemplateClass : KCSUser.self
 var query = KCSQuery(onField: KCSEntityKeyId, withRegex: regexString)
 query.addQueryOnField(KCSUserAttributeUsername, usingConditional: KCSQueryConditional.KCSRegex, forValue: "/\(containsString)/")
 request = store.queryWithQuery(query, withCompletionBlock: {

Regex is made right , I checked twice, I think you just disabled regex on user collection on id. 

Hey Damien, 
I achieved Search substring with case - insensitive with following regex.

" : "^.*(?i)_strSearchText.*"


We do not support full-string search, only case-sensitive anchor matches for the beginning of strings will work within Kinvey at this time.


Login or Signup to post a comment