Start a new topic

query "starts with" or "like" type

 Hi! For example I have the names "Alan" and "Alen" in my collection. There is a query for the case where I search all the names starting with "al" ??

1 Comment

Hi Dan,


Doing this via the API console is pretty simple you can simply request: /appdata/kid_Te5Spq4_zC/firstNames/?query={"firstName":{"$regex":"^Jo"} }


Which would match "Joe" or "John" but not "john" or "joe" (it's case sensitive / anchored to the beginning of the string).


Doing this in one of the javascript libraries means that you could use the "contains" query:  which is outlined over here:  http://devcenter.kinvey.com/html5/guides/datastore#operators


Please let me know if you need anymore help with this.


Thanks,


1 person likes this
Login or Signup to post a comment