I'm just trying out the Kohana MongoDB ORM: MangoDB. I'm trying to figure out how to do a where like.
$query['city'] = $this->request->query('location');
$results = Mango::factory('salon')
->load(array(
'limit' => null,
'criteria' => $query
));
I want to change this to do a where like:
SELECT * FROM salon WHERE city LIKE '%London%'
MongoDB supports regular expressions:
db.collection.find( { city: /*London*/i } );See documentation here: http://docs.mongodb.org/manual/reference/operator/regex/