databaseapacheescapingusergridsingle-quotes

How can I select entities from Apache Usergrid with single quote


I'm trying to figure out how to escape a single quote for a query of a Usergrid collection. I can't find anything about it in the documentation or online. For example I have a Book collection and I want to select those with the title "Charolette's Web"

/books/?ql=select*where title = 'Charlotte\'s Web'

This query does not give back any results from the database query. I also tried '' as the escape character (like sql) but that didn't work either.


Solution

  • As far as I know, there's no way to escape quotes in a ql request at the current time.

    You could work around this by using a contains clause:

    ?ql=select * where title contains 'Charlotte'
    

    I've opened an issue for it to be looked at here.