With Flint's ArangoDB  Connector you can perform all database related operations on ArangoDB database .

With this document, we will be able to use and work with the ArangoDB  Connector.

 

Design Aspects

Perform all standard application  like create collection,create document,list documents available through the Arangodb SDK. Some of them are listed below:
 

  • Save data to document
  • Get  data from documents
  • List documents
  • Execute query on document
  • Create collection
  • Delete document from collection
  • The ability to set Connector execution timeouts

  • Synchronous / Asynchronous execution of the Connector

Connector Configuration

Configuration parameters
Parameter

Description

Required

nameArangodb connector name to be configuredtrue: config/request
hostHost name where the database is installedtrue: config/request
usernameUsername of arangodbtrue: config/request
passwordPassword of arangodbtrue: config/request
databaseName of arangodb databasetrue: config/request
portPort on which arangodb is runningtrue: config/request
Example
{ 
   "password": "root",
   "port": 8529, 
   "database-name": "test", 
   "name": "arangoDB", 
   "target": "localhost",
   "username": "root"
}

 

Actions

save

 save data to arangodb database collection using collection name

Request parameters
ParameterDescriptionRequired
connector_nameName of the arangoDB Connector to calltrue
actionContains the name of the operation: savetrue
collection-nameName of collection in which you want to save datatrue
dataData which you want to save into given collection with keytrue
timeoutTimeout for arangoDB connector executionfalse
Response parameters
ParameterDescription
statusstatus contain exit-code and message
Example
 
data{} 
data["_key"] = "1" 
data["Employee name"] ="roy" 
data["age"] = 23   
response = @call.connector("arangoDB")
			    .set('action',"save") 
                .set('collection-name',"test") 
                .set('data',data) 
                .sync  
 response_exitcode = response.exitcode # Exit status code 
 response_message = response.message # Execution status message

get

get details of document from given collection

Request parameters
ParameterDescriptionRequired
connector_nameName of the arangoDB Connector to calltrue
actionContains the name of the operation: gettrue
collection-nameName of collection from which you want to get data of documenttrue
_keykey of document from which you want to get detailstrue
timeoutTimeout for arangoDB connector executionfalse
Response parameters
ParameterDescription
document-detailsall details about document with all fields
Example
 
response = @call.connector("arangoDB") 
				.set('action',"get")
			    .set('collection-name',"test") 
                .set('_key',"1") 
                .sync 
 response_exitcode = response.exitcode # Exit status code
 response_message = response.message # Execution status message
 #arangoDB Connector Response Parameters 
 document_details=response

list

list documents form given collection from arangoDb database

Request parameters
ParameterDescriptionRequired
connector_nameName of the arangoDB Connector to calltrue
actionContains the name of the operation: listtrue
collection-nameName of collection from which you want to get data of documenttrue
queryquery to perform on collection/documentfalse
timeoutTimeout for arangoDB connector executionfalse
Response parameters
ParameterDescription
document-listList of documents with details of each document
Example

response = @call.connector("arangoDB") 
				.set('action',"list")
			    .set('collection-name',"test")
 				.sync
 
response_exitcode = response.exitcode # Exit status code 
response_message = response.message # Execution status message
 
#arangoDB Connector Response Parameters
 document_list=response

delete

delete document from given collection

Request parameters
ParameterDescriptionRequired
connector_nameName of the arangoDB Connector to calltrue
actionContains the name of the operation: deletetrue
collection-nameName of collection from which you want to delete documenttrue
_keykey of document from which you want to deletetrue
timeoutTimeout for arangoDB connector executionfalse
Response parameters
ParameterDescription
statusstatus contain exit-code and message which shows document deleted or not
Example
response = @call.connector("arangoBD") 
	 		    .set('action',"delete") 
				.set('collection-name',"test") 
			    .set('_key',"1")
 			    .sync 
 
response_exitcode = response.exitcode # Exit status code 
response_message = response.message # Execution status message

 

execute-query

To execute any type of operation through AQL query on collection/document

Request parameters
ParameterDescriptionRequired
connector_nameName of the arangoDB Connector to calltrue
actionContains the name of the operation: execute-querytrue
collection-nameName of collection on which you want to execute querytrue
queryAQL query which you want to execute on collectiontrue
timeoutTimeout for arangoDB connector executionfalse
Response parameters
ParameterDescription
query-detailsall details after executing query
Example
 
response = @call.connector("arangoBD") 
				.set('action',"execute-query") 
				.set('collection-name',"test") 
				.set('query',"For doc IN test RETURN doc")
 			    .sync 
 
 response_exitcode = response.exitcode # Exit status code
 response_message = response.message # Execution status message  
 #arangoDB Connector Response Parameters
 query_details=response

 

create-collection

create collection in the arangodb database

Request parameters
ParameterDescriptionRequired
connector_nameName of the arangoDB Connector to calltrue
actionContains the name of the operation: create-collectiontrue
collection-nameName of collection on which you want to createtrue
timeoutTimeout for arangoDB connector executionfalse
Response parameters
ParameterDescription
status-messagestatus message for collection created or not
Example

 
response = @call.connector("arangoBD") 
				.set('action',"create-collection")
			    .set('collection-name',"test collection") 
				.sync 
response_exitcode = response.exitcode # Exit status code 
response_message = response.message # Execution status message
 

On this page: