The Analytica Shell provides ‘programmatic’ access to Analytica’s functionality. Instead of using a graphical user environment like the iPhone, browser or Excel, the Analytica Shell supports a typical shell behavior for users that need to quickly try out some analytics or simply are tuned to this type of command-line style interface.
Introduction
The shell is started up by launching an executable (usually called AnalyticaS or analyticaS.exe). Once the shell started up, it displays the following:
Welcome to ANALYTICA! For help, type help. -->
To see all possible commands the shell can execute, issue ‘help’:
Welcome to ANALYTICA!
For help, type help.
-->help
Commands:
autoconnect <database host> <database port> <database login> <database password>
autodiscover <database host> <database port> <database login> <database password>
connect <database host> <database port> <database login> <database password> <database name> <database type>
connectionstatus
describe <collection path>
directmode
disconnect <database host> <database port> <database name> <database type>
disconnectall
executeXL <XL expression>
executionsettings
exit
forget <collection path>
forgetvc <virtual collection name> <database name>
get <collection path>
help
list
listvc
parseXL <XL expression>
update <collection path> = <XL expression>
updatevc <virtual collection name> <database name> <database collection> <database query>
restmode <hostname:port>
runReport <report name>
saveas <source database name> <source collection name> <target database name> <target collection name>
set <collection path> = <XL expression>
setvc <virtual collection name> <database name> <database collection> <database query>
setEnforceTypeChecking <yes|no>
setProcessingLimit <limit; -1 for complete result>
setResultAnnotation <yes|no>
setResultSetSize <limit; -1 for complete result>
setSamplingSize <limit; -1 for complete result>
setSamplingSizeDescribe <limit; -1 for complete result>
setSamplingSizeTypeAnalysis <limit; -1 for complete result>
setStrictExecution <yes|no>
setStrictTyping <yes|no>
sizingsettings
-->
The section www.analytica.com/technology/shell-client/ shows the shell in action.
Shell Command Overview
In the following, all shell commands are listed and explained.
autoconnect <database host> <database port> <database login> <database password>
- Effect: connects automatically to all databases on the database host
- The default password for MongoDB databases without authentication is “—” and “—” (three dashes each)
- database host: hostname of the server where the MongoDB is located
- database port: port number of the server where the MongoDB is located
- database login: login of the database (if defined)
- database password: password of the database (if defined)
autodiscover <database host> <database port> <database login> <database password>
- Effect: discovers, but does not connect, to all databases on database host
- The default password for MongoDB databases without authentication is “—” and “—” (three dashes each)
- database host: hostname of the server where the MongoDB is located
- database port: port number of the server where the MongoDB is located
- database login: login of the database (if defined)
- database password: password of the database (if defined)
connect <database host> <database port> <database login> <database password> <database name> <database type>
- Effect: connects to a single data source
- The default password for MongoDB databases without authentication is “—” and “—” (three dashes each)
- database host: hostname of the server where the MongoDB is located
- database port: port number of the server where the MongoDB is located
- database login: login of the database (if defined)
- database password: password of the database (if defined)
- database name: name of the database
- database type: “MongoDB” in case of MongoDB
connectionstatus
- Effect: returns a list of all connected data sources
describe <collection path>
- Effect: returns the list of property data types of the property
- collection path: path to an existing property
directmode
- Effect: executes all commands in the same process as the shell; the Analytica server in this case is not a separate process but inline with the shell itself
disconnect <database host> <database port> <database name> <database type>
- Effect: disconnects from this particular data source
- database host: hostname of the server where the MongoDB is located
- database port: port number of the server where the MongoDB is located
- database name: name of the database
- database type: “MongoDB” in case of MongoDB
disconnectall
- Effect: disconnects from all connected data sources
executeXL <XL expression>
- Effect: executes the XL expression and returns the result values
- XL expression: an XL expression
executionsettings
- Effect: retrieves all execution settings
exit
- Effect: exists the shell
forget <collection path>
- Effect: deletes an existing calculated property
- collection path: path to the calculated property
forgetvc <virtual collection name> <database name>
- Effect: removes an existing virtual collection
- virtual collection name: name of existing virtual collection
- database name: name of data source for which virtual collection is created
get <collection path>
- Effect: gets the values of the property
- collection path: path to an existing property
help
- Effect: displays a list of all shell commands
list
- Effect: Lists all calculated property definitions
listvc
- Effect: lists all definitions of virtual collections
parseXL <XL expression>
- Effect: parses the XL expression and returns either success or parse errors
- XL expression: an XL expression
update <collection path> = <XL expression>
- Effect: updates an existing calculated property
- collection path: path to the existing calculated property
- XL expression: XL Expression defining the computation for the new value of the existing calculated property
updatevc <virtual collection name> <database name> <database collection> <database query>
- Effect: updates an existing virtual collection
- virtual collection name: name of existing virtual collection
- database name: name of data source for which virtual collection is created
- database collection: name of collection in data source to which query is applied
- database query: data source native query that selects documents from dataSourceCollectionName into virtualCollectionName
restmode <hostname:port>
- Effect: configures the shell to connect to an Analytica server on a different machine
- hostname: name or IP address of the machine that hosts the Analytica server
- port: 8123
runReport <report name>
- Effect: executes a defined report
- report name: name of report
saveas <source database name> <source collection name> <target database name> <target collection name>
- Effect: saves the document from source collection name in the source database name to the target collection name in the target database name (overwrite)
- source database name: name of the source data source
- source collection name: name of the source collection
- target database name: name of the target data source
- target collection name: name of the target collection
set <collection path> = <XL expression>
- Effect: creates a new calculated property
- collection path: path to the new calculated property
- XL expression: XL Expression defining the computation for the value of the new calculated property
setvc <virtual collection name> <database name> <database collection> <database query>
- Effect: creates a virtual collection
- virtual collection name: name of new virtual collection
- database name: name of data source for which virtual collection is created
- database collection: name of collection in data source to which query is applied
- database query: data source native query that selects documents from database collection into virtual collection name
setEnforceTypeChecking <yes|no>
- Effect: enforces a semantic check of XL expressions against the inferred types
- parameter: yes | no
setProcessingLimit <limit; -1 for complete result>
- Effect: sets the maximum number of documents to be processed
- parameter: new limit for the number of documents to be processed; -1 for all documents
setResultAnnotation <yes|no>
- Effect: adds a property to the result document indicating if the documents are meta-data or instance data
- parameter: yes | no
setResultSetSize <limit; -1 for complete result>
- Effect: sets the maximum number of documents in the result set
- parameter: new limit for the number of documents to be returned as result; -1 for all documents
setSamplingSize <limit; -1 for complete result>
- Effect: sets the sampling size
- parameter: new sampling size to take; -1 for all documents
setSamplingSizeDescribe <limit; -1 for complete result>
- Effect: sets the sampling size for the describe
- parameter: new sampling size to take for describe; -1 for all documents
setSamplingSizeTypeAnalysis <limit; -1 for complete result>
- Effect: sets the sampling size for the type analysis
- parameter: new sampling size to take for the type analysis; -1 for all documents
setStrictExecution <yes|no>
- Effect: enforces that all properties that are asked for are present/best effort otherwise
- parameter: yes | no
setStrictTyping <yes|no>
- Effect: enforces strict typing or not. Strict typing takes the order of properties in documents into account
- parameter: yes | no
sizingsettings
- Effect: retrieves all sizing settings
