# SyncGateway.QueryApi

All URIs are relative to *http://localhost:4984/*

Method | HTTP request | Description
------------- | ------------- | -------------
[**dbDesignDdocViewViewGet**](QueryApi.md#dbDesignDdocViewViewGet) | **GET** /{db}/_design/{ddoc}/_view/{view} | Query a view


<a name="dbDesignDdocViewViewGet"></a>
# **dbDesignDdocViewViewGet**
> QueryResult dbDesignDdocViewViewGet(dbddoc, view, opts)

Query a view

Query a view on a design document. This endpoint is only accessible if you have enabled views in the Sync Gateway configuration file (see [this guide](/documentation/mobile/current/develop/guides/sync-gateway/views/index.html) for more information on this topic). 

### Example
```javascript
var SyncGateway = require('sync_gateway');
var defaultClient = SyncGateway.ApiClient.default;

// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

var apiInstance = new SyncGateway.QueryApi();

var db = "db_example"; // String | Database name

var ddoc = "ddoc_example"; // String | Design document name

var view = "view_example"; // String | View name

var opts = { 
  'conflicts': true, // Boolean | Include conflict information in the response. This parameter is ignored if the include_docs parameter is false.
  'descending': true, // Boolean | Return documents in descending order.
  'endkey': "endkey_example", // String | If this parameter is provided, stop returning records when the specified key is reached.
  'endKey': "endKey_example", // String | Alias for the endkey parameter.
  'endkeyDocid': "endkeyDocid_example", // String | If this parameter is provided, stop returning records when the specified document identifier is reached.
  'endKeyDocId': "endKeyDocId_example", // String | Alias for the endkey_docid parameter.
  'includeDocs': true, // Boolean | Indicates whether to include the full content of the documents in the response.
  'inclusiveEnd': true, // Boolean | Indicates whether the specified end key should be included in the result.
  'group': true, // Boolean | Group the results using the reduce function to a group or single row.
  'groupLevel': 56, // Number | Specify the group level to be used.
  'key': "key_example", // String | If this parameter is provided, return only document that match the specified key.
  'limit': 56, // Number | If this parameter is provided, return only the specified number of documents.
  'skip': 56, // Number | If this parameter is provided, skip the specified number of documents before starting to return results.
  'stale': "stale_example", // String | Allow the results from a stale view to be used, without triggering a rebuild of all views within the encompassing design document. Valid values are ok and update_after.
  'startkey': "startkey_example", // String | If this parameter is provided, return documents starting with the specified key.
  'startKey': "startKey_example", // String | Alias for startkey param.
  'startkeyDocid': "startkeyDocid_example", // String | If this parameter is provided, return documents starting with the specified document identifier.
  'updateSeq': true // Boolean | Indicates whether to include the update_seq property in the response.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.dbDesignDdocViewViewGet(dbddoc, view, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **db** | **String**| Database name | 
 **ddoc** | **String**| Design document name | 
 **view** | **String**| View name | 
 **conflicts** | **Boolean**| Include conflict information in the response. This parameter is ignored if the include_docs parameter is false. | [optional] 
 **descending** | **Boolean**| Return documents in descending order. | [optional] 
 **endkey** | **String**| If this parameter is provided, stop returning records when the specified key is reached. | [optional] 
 **endKey** | **String**| Alias for the endkey parameter. | [optional] 
 **endkeyDocid** | **String**| If this parameter is provided, stop returning records when the specified document identifier is reached. | [optional] 
 **endKeyDocId** | **String**| Alias for the endkey_docid parameter. | [optional] 
 **includeDocs** | **Boolean**| Indicates whether to include the full content of the documents in the response. | [optional] 
 **inclusiveEnd** | **Boolean**| Indicates whether the specified end key should be included in the result. | [optional] 
 **group** | **Boolean**| Group the results using the reduce function to a group or single row. | [optional] 
 **groupLevel** | **Number**| Specify the group level to be used. | [optional] 
 **key** | **String**| If this parameter is provided, return only document that match the specified key. | [optional] 
 **limit** | **Number**| If this parameter is provided, return only the specified number of documents. | [optional] 
 **skip** | **Number**| If this parameter is provided, skip the specified number of documents before starting to return results. | [optional] 
 **stale** | **String**| Allow the results from a stale view to be used, without triggering a rebuild of all views within the encompassing design document. Valid values are ok and update_after. | [optional] 
 **startkey** | **String**| If this parameter is provided, return documents starting with the specified key. | [optional] 
 **startKey** | **String**| Alias for startkey param. | [optional] 
 **startkeyDocid** | **String**| If this parameter is provided, return documents starting with the specified document identifier. | [optional] 
 **updateSeq** | **Boolean**| Indicates whether to include the update_seq property in the response. | [optional] 

### Return type

[**QueryResult**](QueryResult.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

