# OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi

All URIs are relative to */*

Method | HTTP request | Description
------------- | ------------- | -------------
[**cloneCollection**](CollectionsApi.md#cloneCollection) | **POST** /core/v1/collections/x-collection-name/clone | Clone a collection to hold vertices/edges of a graph
[**containsElement**](CollectionsApi.md#containsElement) | **POST** /core/v1/collections/x-collection-name/contains | Checks presence of element in collection
[**createCollection**](CollectionsApi.md#createCollection) | **POST** /core/v1/collections | Create a collection
[**destroyCollection**](CollectionsApi.md#destroyCollection) | **DELETE** /core/v1/collections/x-collection-name | Delete a collection
[**getCollection**](CollectionsApi.md#getCollection) | **GET** /core/v1/collections/x-collection-name | Get a specific collection for a graph
[**getCollections**](CollectionsApi.md#getCollections) | **GET** /core/v1/collections | List all collections for a graph
[**isCollectionMutable**](CollectionsApi.md#isCollectionMutable) | **GET** /core/v1/collections/x-collection-name/isMutable | Check whether a collection is mutable.
[**removeAllFromCollection**](CollectionsApi.md#removeAllFromCollection) | **DELETE** /core/v1/collections/x-collection-name/elements | Clear a collection
[**toMutableCollection**](CollectionsApi.md#toMutableCollection) | **POST** /core/v1/collections/x-collection-name/toMutable | Creates a mutable copy of a collection to hold vertices/edges of a graph

<a name="cloneCollection"></a>
# **cloneCollection**
> cloneCollection(body, SID, xCollectionName)

Clone a collection to hold vertices/edges of a graph

The collection gets destroyed once the session gets destroyed or #destroyCollection(String, String, boolean)} is called. As collections can only hold nodes or edges, they also become unusable once the graph the node/edges belong to is destroyed.

### Example
```javascript
import {OracleLabsParallelGraphAnalyticsPgxRestApi} from 'oracle_labs_parallel_graph_analytics__pgx_rest_api';

let apiInstance = new OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi();
let body = new OracleLabsParallelGraphAnalyticsPgxRestApi.CloneCollectionRequest(); // CloneCollectionRequest | object holding the new name of the collection to be created
let SID = "SID_example"; // String | session ID
let xCollectionName = "xCollectionName_example"; // String | name of the collection to be cloned

apiInstance.cloneCollection(body, SID, xCollectionName, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**CloneCollectionRequest**](CloneCollectionRequest.md)| object holding the new name of the collection to be created | 
 **SID** | **String**| session ID | 
 **xCollectionName** | **String**| name of the collection to be cloned | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="containsElement"></a>
# **containsElement**
> containsElement(body, SID, xCollectionName)

Checks presence of element in collection

### Example
```javascript
import {OracleLabsParallelGraphAnalyticsPgxRestApi} from 'oracle_labs_parallel_graph_analytics__pgx_rest_api';

let apiInstance = new OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi();
let body = new OracleLabsParallelGraphAnalyticsPgxRestApi.ContainsElementRequest(); // ContainsElementRequest | Holds the element whose presence is checked.
let SID = "SID_example"; // String | session ID
let xCollectionName = "xCollectionName_example"; // String | name of the collection

apiInstance.containsElement(body, SID, xCollectionName, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**ContainsElementRequest**](ContainsElementRequest.md)| Holds the element whose presence is checked. | 
 **SID** | **String**| session ID | 
 **xCollectionName** | **String**| name of the collection | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="createCollection"></a>
# **createCollection**
> createCollection(body, SID)

Create a collection

you can also call this method to create a collection from a filter expression or from a component.

### Example
```javascript
import {OracleLabsParallelGraphAnalyticsPgxRestApi} from 'oracle_labs_parallel_graph_analytics__pgx_rest_api';

let apiInstance = new OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi();
let body = new OracleLabsParallelGraphAnalyticsPgxRestApi.CreateCollectionRequest(); // CreateCollectionRequest | Object which specifies details on how to create the collection.
let SID = "SID_example"; // String | session ID

apiInstance.createCollection(body, SID, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**CreateCollectionRequest**](CreateCollectionRequest.md)| Object which specifies details on how to create the collection. | 
 **SID** | **String**| session ID | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

<a name="destroyCollection"></a>
# **destroyCollection**
> destroyCollection(SID, xCollectionName, opts)

Delete a collection

### Example
```javascript
import {OracleLabsParallelGraphAnalyticsPgxRestApi} from 'oracle_labs_parallel_graph_analytics__pgx_rest_api';

let apiInstance = new OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi();
let SID = "SID_example"; // String | session ID
let xCollectionName = "xCollectionName_example"; // String | name of the collection
let opts = { 
  'ignoreNotFound': false, // Boolean | if it's equal to true return null if the graph doesn't exist, otherwise throw an exception
  'csrfToken': "csrfToken_example" // String | CSRF token
};
apiInstance.destroyCollection(SID, xCollectionName, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **SID** | **String**| session ID | 
 **xCollectionName** | **String**| name of the collection | 
 **ignoreNotFound** | **Boolean**| if it&#x27;s equal to true return null if the graph doesn&#x27;t exist, otherwise throw an exception | [optional] [default to false]
 **csrfToken** | **String**| CSRF token | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="getCollection"></a>
# **getCollection**
> getCollection(SID, xCollectionName, graphId)

Get a specific collection for a graph

### Example
```javascript
import {OracleLabsParallelGraphAnalyticsPgxRestApi} from 'oracle_labs_parallel_graph_analytics__pgx_rest_api';

let apiInstance = new OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi();
let SID = "SID_example"; // String | session ID
let xCollectionName = "xCollectionName_example"; // String | the name of the collection
let graphId = "graphId_example"; // String | Id of the graph to filter the collections

apiInstance.getCollection(SID, xCollectionName, graphId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **SID** | **String**| session ID | 
 **xCollectionName** | **String**| the name of the collection | 
 **graphId** | **String**| Id of the graph to filter the collections | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="getCollections"></a>
# **getCollections**
> getCollections(SID, graphId)

List all collections for a graph

### Example
```javascript
import {OracleLabsParallelGraphAnalyticsPgxRestApi} from 'oracle_labs_parallel_graph_analytics__pgx_rest_api';

let apiInstance = new OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi();
let SID = "SID_example"; // String | session ID
let graphId = "graphId_example"; // String | Name of the graph to filter the collections

apiInstance.getCollections(SID, graphId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **SID** | **String**| session ID | 
 **graphId** | **String**| Name of the graph to filter the collections | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="isCollectionMutable"></a>
# **isCollectionMutable**
> isCollectionMutable(SID, xCollectionName)

Check whether a collection is mutable.

### Example
```javascript
import {OracleLabsParallelGraphAnalyticsPgxRestApi} from 'oracle_labs_parallel_graph_analytics__pgx_rest_api';

let apiInstance = new OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi();
let SID = "SID_example"; // String | session ID
let xCollectionName = "xCollectionName_example"; // String | name of the collection

apiInstance.isCollectionMutable(SID, xCollectionName, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **SID** | **String**| session ID | 
 **xCollectionName** | **String**| name of the collection | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="removeAllFromCollection"></a>
# **removeAllFromCollection**
> removeAllFromCollection(SID, xCollectionName, opts)

Clear a collection

This will result in an empty collection if successful.

### Example
```javascript
import {OracleLabsParallelGraphAnalyticsPgxRestApi} from 'oracle_labs_parallel_graph_analytics__pgx_rest_api';

let apiInstance = new OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi();
let SID = "SID_example"; // String | session ID
let xCollectionName = "xCollectionName_example"; // String | name of the collection
let opts = { 
  'csrfToken': "csrfToken_example" // String | CSRF token
};
apiInstance.removeAllFromCollection(SID, xCollectionName, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **SID** | **String**| session ID | 
 **xCollectionName** | **String**| name of the collection | 
 **csrfToken** | **String**| CSRF token | [optional] 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="toMutableCollection"></a>
# **toMutableCollection**
> toMutableCollection(body, SID, xCollectionName)

Creates a mutable copy of a collection to hold vertices/edges of a graph

The collection gets destroyed once the session gets destroyed or #destroyCollection(String, String, boolean)} is called. As collections can only hold nodes or edges, they also become unusable once the graph the node/edges belong to is destroyed.

### Example
```javascript
import {OracleLabsParallelGraphAnalyticsPgxRestApi} from 'oracle_labs_parallel_graph_analytics__pgx_rest_api';

let apiInstance = new OracleLabsParallelGraphAnalyticsPgxRestApi.CollectionsApi();
let body = new OracleLabsParallelGraphAnalyticsPgxRestApi.CloneCollectionRequest(); // CloneCollectionRequest | object holding the new name of the collection to be created (if null, a name is generated)
let SID = "SID_example"; // String | session ID
let xCollectionName = "xCollectionName_example"; // String | name of the collection

apiInstance.toMutableCollection(body, SID, xCollectionName, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**CloneCollectionRequest**](CloneCollectionRequest.md)| object holding the new name of the collection to be created (if null, a name is generated) | 
 **SID** | **String**| session ID | 
 **xCollectionName** | **String**| name of the collection | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

