Finds all objects by collection name and return an IterableResult

@param string $collectionName
@return IterableResult
559415
public function findByCollectionNameIterator($collectionName)
    {
        /** @var QueryBuilder $queryBuilder */
        $queryBuilder = $this->entityManager->createQueryBuilder();
        return $queryBuilder
            ->select('PersistentResource')
            ->from($this->getEntityClassName(), 'PersistentResource')
            ->where('PersistentResource.collectionName = :collectionName')
            ->setParameter(':collectionName', $collectionName)
            ->getQuery()->iterate();
    }
377637
private MongoCollection<Document> getDBCollection(String docName) {
        if (docName == null || docName.length() == 0) {
            return null;
        }
        return mongoDatabase.getCollection(docName);
    }
1293448
public function getCollection($collectionName)
    {
        $this->initialize();

        return isset($this->collections[$collectionName]) ? $this->collections[$collectionName] : null;
    }
369835
public function createCollection($collectionName, array $options = [])
    {
        $cursor = $this->executeCommand(['create' => $collectionName], $options);

        return $cursor->current();
    }
693225
public function findBySha1AndCollectionName($sha1Hash, $collectionName)
    {
        $query = $this->createQuery();
        $query->matching(
            $query->logicalAnd(
                $query->equals('sha1', $sha1Hash),
                $query->equals('collectionName', $collectionName)
            )
        );
        $resources = $query->execute()->toArray();
        foreach ($this->addedResources as $importedResource) {
            if ($importedResource->getSha1() === $sha1Hash && $importedResource->getCollectionName() === $collectionName) {
                $resources[] = $importedResource;
            }
        }

        return $resources;
    }
617021
public function get($name)
    {
        if (!array_key_exists($name, $this->items)) {
            throw new CollectionUnknownKeyException(sprintf('Item name=%s does not exist in collection',$name));
        }

        return $this->items[$name];
    }
688966
public function get($name)
    {
        return isset($this->collection[$name]) ? $this->collection[$name] : null;
    }
370445
public function selectCollection($name, array $options = [])
    {
        if (!isset($this->collections[$name])) {
            $this->createCollection($name);
        }
        return $this->collections[$name]['collection'];
    }
759337
public function collection($collectionId)
    {
        return new CollectionReference(
            $this->connection,
            $this->valueMapper,
            $this->childPath($this->name, $collectionId)
        );
    }
203787
protected function get_collection_from() {
        if ($this->collectionfrom === null) {
            $this->collectionfrom = api::search_competencies('', $this->from);
        }
        return $this->collectionfrom;
    }
185555
public function setDbCollection(string $dbName, string $collectionName): \MongoCollection
    {
        return $this->mongoClient->selectDB($dbName)->selectCollection($collectionName);
    }
525789
private function findAlternatives($name, $collection)
    {
        $threshold = 1e3;
        $alternatives = [];

        $collectionParts = [];
        foreach ($collection as $item) {
            $collectionParts[$item] = explode(':', $item);
        }

        foreach (explode(':', $name) as $i => $subname) {
            foreach ($collectionParts as $collectionName => $parts) {
                $exists = isset($alternatives[$collectionName]);
                if (!isset($parts[$i]) && $exists) {
                    $alternatives[$collectionName] += $threshold;
                    continue;
                } elseif (!isset($parts[$i])) {
                    continue;
                }

                $lev = levenshtein($subname, $parts[$i]);
                if ($lev <= \strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) {
                    $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev;
                } elseif ($exists) {
                    $alternatives[$collectionName] += $threshold;
                }
            }
        }

        foreach ($collection as $item) {
            $lev = levenshtein($name, $item);
            if ($lev <= \strlen($name) / 3 || false !== strpos($item, $name)) {
                $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev;
            }
        }

        $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; });
        ksort($alternatives, SORT_NATURAL | SORT_FLAG_CASE);

        return array_keys($alternatives);
    }
175140
public function createCollection($collectionName, array $options = [])
    {
        $this->document = $this->db->getQueryBuilder()->createCollection($collectionName, $options);

        $result = current($this->execute()->toArray());
        return $result['ok'] > 0;
    }
417977
public function getCollection(string $resourceClass, string $operationName = null): iterable
    {
        $collection = $this->repository->findAll($resourceClass);

        return new Paginator(new GenericPaginatedDomainCollection((static function () use ($collection): iterable {
            foreach ($collection as $document) {
                yield $document->toProjection();
            }
        })(), $collection->getOffset(), $collection->getLimit(), (float) \count($collection), $collection->getTotalCount()));
    }
330892
protected function getCollectionFilePath(string $collectionName): string
    {
        return $this->storageDir . '/' . $this->dbName . '_'
            . $this->normalize($collectionName) . '.' . self::EXTENSION;
    }
236121
public function getAll($collection, array $options = [])
    {
        /** @var AbstractHttpRequest $request */
        $request          = $this->getRequest();
        $request->options = $options;
        $request->path    = $this->client->fullDatabasePath . static::API_PATH;
        $request->path .= '?collection=' . $collection;
        $request->method = static::METHOD_GET;

        return $this->getReturnObject($request);
    }
490299
public function findFirst($collectionName, array $criteria = [], array $fields = []) {
		$collection = $this->getCollection($collectionName);
		
		if ($this->_profilerEnabled) {
			$message = 'db.' . $collectionName . '.findOne(';

			if (empty($criteria)) {
				$message .= ');';
			} else {
				$message .= json_encode($criteria) . ');';
			}

			$event = $this->getProfiler()->startRead($message);
		}

		$result = $collection->findOne($criteria, $fields);

		if ($this->_profilerEnabled) {
			$event->stopSuccess();
		}

		return $result;
	}