I'm using below query to find the duplicate record.
$doc = $db->collection->findOne(array('field' => new MongoRegex("/^$value/i")));
if (isset($doc) === false) {
$db->collection->insert(array('field' => $value));
}
This works fine until a special character comes like "(", ")", and might be some more. How should I change my query to work in these cases?