Parse.com PHP contains() 方法
Parse.com PHP contains() method
我需要一个等同于 SQL LIKE 语句的 Parse Query 方法,因为我想在键中搜索子字符串价值。我查看了 Parse 文档,发现 Javascript 和 iOS SDK 的 Parse 都有一个方法 contains 在任何键的值中查找子字符串。
但是Parse PHPSDK中没有这样的方法。在 PHP 中有没有办法实现这一点?
来自文档:
Use startsWith to restrict to string values that start with a particular string. Similar to a MySQL LIKE operator, this is indexed so it is efficient for large datasets
// Finds barbecue sauces that start with "Big Daddy's".
$query = new ParseQuery("BarbecueSauce");
$query->startsWith("name", "Big Daddy's");
因为Parse中没有这个函数PHP API。所以,我转向 Cloud Code 并编写了一个云函数,因为 Parse Javascript API 有一个 contains() 函数来搜索子字符串。
我需要一个等同于 SQL LIKE 语句的 Parse Query 方法,因为我想在键中搜索子字符串价值。我查看了 Parse 文档,发现 Javascript 和 iOS SDK 的 Parse 都有一个方法 contains 在任何键的值中查找子字符串。
但是Parse PHPSDK中没有这样的方法。在 PHP 中有没有办法实现这一点?
来自文档:
Use startsWith to restrict to string values that start with a particular string. Similar to a MySQL LIKE operator, this is indexed so it is efficient for large datasets
// Finds barbecue sauces that start with "Big Daddy's".
$query = new ParseQuery("BarbecueSauce");
$query->startsWith("name", "Big Daddy's");
因为Parse中没有这个函数PHP API。所以,我转向 Cloud Code 并编写了一个云函数,因为 Parse Javascript API 有一个 contains() 函数来搜索子字符串。