0

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%'
Braiam
  • 1
  • 11
  • 47
  • 78
iamjonesy
  • 24,732
  • 40
  • 139
  • 206

1 Answers1

0

MongoDB supports regular expressions:

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

See documentation here: http://docs.mongodb.org/manual/reference/operator/regex/

rakhim
  • 164
  • 8