Collection

let dataCollection = new Collection(kuzzle, "my-collection", "my-index")
Collection myCollection = new Collection(kuzzle, "my-collection", "my-index");
<?php

use \Kuzzle\Kuzzle;
use \Kuzzle\Collection;

$kuzzle = new Kuzzle('localhost');
$dataCollection = new Collection($kuzzle, 'my-collection', 'my-index');

In Kuzzle, you manipulate documents and subscriptions, both related to data collections.

A data collection is a set of data managed by Kuzzle. It acts like a data table for persistent documents, or like a room for pub/sub messages.


Collection(kuzzle, collection, index)

ArgumentsTypeDescription
kuzzleobjectKuzzle object
collectionstringThe name of the data collection you want to manipulate
indexstringName of the index containing the data collection

Note: It's recommended to instantiate a Collection object by calling Kuzzle.collection rather than using the constructor directly


Properties

Property nameTypeDescriptionget/set
kuzzleobjectlinked kuzzle instanceget
indexobjectName of the index containing the data collectionget
collectionstringThe name of the data collection handled by this instanceget
headersobjectHeaders for all sent documents.get/set

Note: the headers property is inherited from the main Kuzzle object and can be overrided