ensureIndex() public method

Ensure index
public ensureIndex ( array $keys, array $options = [], callable $cb = null ) : void
$keys array Keys
$options array Optional. Options
$cb callable Optional. Callback called when response received
return void
コード例 #1
0
 /**
  *
  */
 public function init()
 {
     $this->externalAuthTokens = $this->appInstance->db->{$this->appInstance->dbname . '.externalAuthTokens'};
     $this->externalAuthTokens->ensureIndex(['extTokenHash' => 1], ['unique' => true]);
 }
コード例 #2
0
 /**
  *
  */
 public function init()
 {
     $this->externalSignupRequests = $this->appInstance->db->{$this->appInstance->dbname . '.externalSignupRequests'};
     $this->externalSignupRequests->ensureIndex(['code' => 1, 'email' => 1], ['unique' => true]);
 }