0

我只是在试用 Kohana MongoDB ORM:MangoDB。我试图弄清楚如何做一个where like.

$query['city'] = $this->request->query('location');
$results = Mango::factory('salon')
    ->load(array(
        'limit' => null,
        'criteria' => $query
    ));

我想将其更改为执行以下操作:

SELECT * FROM salon WHERE city LIKE '%London%'
4

1 回答 1

0

MongoDB 支持正则表达式:

db.collection.find( { city: /*London*/i } );

请参阅此处的文档:http: //docs.mongodb.org/manual/reference/operator/regex/

于 2013-04-23T08:00:42.917 回答