# LiveQuery

## AV. LiveQuery

A LiveQuery, created by AV.Query#subscribe is an EventEmitter notifies changes of the Query.

## Constructor

#### new LiveQuery()

Source:
  - live-query.js, line 12
Since:
  - 3.0.0

### Methods

#### unsubscribe() → {Promise}

Source:
  - live-query.js, line 71

unsubscribe the query

##### Returns:

Type
  Promise

### Events

#### create

Source:
  - live-query.js, line 52

A new AV.Object which fulfills the Query you subscribe is created.

##### Parameters:

Name | Type | Description
--- | --- | ---
`target` | AV.Object | AV.File | updated object

#### delete

Source:
  - live-query.js, line 57

An existing AV.Object which fulfills the Query you subscribe is deleted.

##### Parameters:

Name | Type | Description
--- | --- | ---
`target` | AV.Object | AV.File | updated object

#### enter

Source:
  - live-query.js, line 38

An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.

##### Parameters:

Name | Type | Description
--- | --- | ---
`target` | AV.Object | AV.File | updated object
`updatedKeys` | Array.<String> | updated keys

#### leave

Source:
  - live-query.js, line 44

An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.

##### Parameters:

Name | Type | Description
--- | --- | ---
`target` | AV.Object | AV.File | updated object
`updatedKeys` | Array.<String> | updated keys

#### update

Source:
  - live-query.js, line 32

An existing AV.Object which fulfills the Query you subscribe is updated.

##### Parameters:

Name | Type | Description
--- | --- | ---
`target` | AV.Object | AV.File | updated object
`updatedKeys` | Array.<String> | updated keys