lithium\data\source\MongoDb::sources()

public method

Returns the list of collections in the currently-connected database.

Parameters

  • string $class

    The fully-name-spaced class name of the model object making the request.

Returns

array

Returns an array of objects to which models can connect.

Source

	public function sources($class = null) {
		$collections = $this->manager->executeCommand($this->_config['database'], new Command(['listCollections' => 1]));
		$names = [];
		foreach ($collections as $collection) {
			$names[] = $collection->name;
		}
		return $names;
	}