当前位置: 首页>>代码示例>>PHP>>正文


PHP Server::executeQuery方法代码示例

本文整理汇总了PHP中MongoDB\Driver\Server::executeQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::executeQuery方法的具体用法?PHP Server::executeQuery怎么用?PHP Server::executeQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MongoDB\Driver\Server的用法示例。


在下文中一共展示了Server::executeQuery方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeLegacy

 /**
  * Returns information for all indexes for this collection by querying the
  * "system.indexes" collection (MongoDB <3.0).
  *
  * @param Server $server
  * @return IndexInfoIteratorIterator
  */
 private function executeLegacy(Server $server)
 {
     $filter = array('ns' => $this->databaseName . '.' . $this->collectionName);
     $options = isset($this->options['maxTimeMS']) ? array('modifiers' => array('$maxTimeMS' => $this->options['maxTimeMS'])) : array();
     $cursor = $server->executeQuery($this->databaseName . '.system.indexes', new Query($filter, $options));
     $cursor->setTypeMap(array('root' => 'array', 'document' => 'array'));
     return new IndexInfoIteratorIterator($cursor);
 }
开发者ID:Kozzi11,项目名称:mongo-php-library-prototype,代码行数:15,代码来源:ListIndexes.php

示例2: executeLegacy

 /**
  * Returns information for all collections in this database by querying the
  * "system.namespaces" collection (MongoDB <3.0).
  *
  * @param Server $server
  *
  * @return CollectionInfoLegacyIterator
  * @throws InvalidArgumentException if filter.name is not a string.
  */
 private function executeLegacy(Server $server)
 {
     $filter = empty($this->options['filter']) ? [] : (array) $this->options['filter'];
     if (array_key_exists('name', $filter)) {
         if (!is_string($filter['name'])) {
             throw InvalidArgumentException::invalidType('filter name for MongoDB <3.0', $filter['name'], 'string');
         }
         $filter['name'] = $this->databaseName . '.' . $filter['name'];
     }
     $options = isset($this->options['maxTimeMS']) ? ['modifiers' => ['$maxTimeMS' => $this->options['maxTimeMS']]] : [];
     $cursor = $server->executeQuery($this->databaseName . '.system.namespaces', new Query($filter, $options));
     $cursor->setTypeMap(['root' => 'array', 'document' => 'array']);
     return new CollectionInfoLegacyIterator($cursor);
 }
开发者ID:phalcon,项目名称:incubator,代码行数:23,代码来源:ListCollections.php

示例3: execute

 /**
  * Execute the operation.
  *
  * @see Executable::execute()
  * @param Server $server
  * @return Cursor
  */
 public function execute(Server $server)
 {
     $readPreference = isset($this->options['readPreference']) ? $this->options['readPreference'] : null;
     return $server->executeQuery($this->databaseName . '.' . $this->collectionName, $this->createQuery(), $readPreference);
 }
开发者ID:pkdevbox,项目名称:mongo-php-library,代码行数:12,代码来源:Find.php

示例4: execute

 /**
  * Execute the operation.
  *
  * @see Executable::execute()
  * @param Server $server
  * @return Cursor
  */
 public function execute(Server $server)
 {
     $readPreference = isset($this->options['readPreference']) ? $this->options['readPreference'] : null;
     $cursor = $server->executeQuery($this->databaseName . '.' . $this->collectionName, $this->createQuery(), $readPreference);
     if (isset($this->options['typeMap'])) {
         $cursor->setTypeMap($this->options['typeMap']);
     }
     return $cursor;
 }
开发者ID:roquie,项目名称:mongo-php-library,代码行数:16,代码来源:Find.php

示例5: execute

 /**
  * Execute the operation.
  *
  * @see Executable::execute()
  * @param Server $server
  * @return Cursor
  */
 public function execute(Server $server)
 {
     return $server->executeQuery($this->databaseName . '.' . $this->collectionName, $this->createQuery());
 }
开发者ID:Kozzi11,项目名称:mongo-php-library-prototype,代码行数:11,代码来源:Find.php


注:本文中的MongoDB\Driver\Server::executeQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。