Orientdb 简明教程
OrientDB - Console Modes
OrientDB 控制台是一个 Java 应用程序,用于处理 OrientDB 数据库和服务器实例。OrientDB 支持多种控制台模式。
The OrientDB Console is a Java Application made to work against OrientDB databases and Server instances. There are several console modes that OrientDB supports.
Interactive Mode
这是默认模式。通过执行以下脚本 bin/console.sh (或在 MS Windows 系统中执行 bin/console.bat )启动控制台即可。确保有执行权限。
This is the default mode. Just launch the console by executing the following script bin/console.sh (or bin/console.bat in MS Windows systems). Make sure to have execution permission on it.
OrientDB console v.1.6.6 www.orientechnologies.com
Type 'help' to display all the commands supported.
orientdb>
完成此步骤后,控制台就可以接受命令。
Once done, the console is ready to accept commands.
Batch Mode
若要在批处理模式中执行命令,运行以下脚本 bin/console.sh (或在 MS Windows 系统中运行 bin/console.bat ),以分号“;”分隔传入的所有命令。
To execute commands in batch mode run the following bin/console.sh (or bin/console.bat in MS Windows systems) script passing all the commands separated with semicolon ";".
orientdb> console.bat "connect remote:localhost/demo;select * from profile"
或者调用控制台脚本,并传入文本格式的文件名,其中包含要执行的命令列表。命令必须以分号“;”分隔。
Or call the console script passing the name of the file in text format containing the list of commands to execute. Commands must be separated with semicolon ";".
Example
Command.txt 包含您想要通过 OrientDB 控制台执行的命令列表。以下命令接受 command.txt 文件中的命令批。
Command.txt contains the list of commands which you want to execute through OrientDB console. The following command accepts the batch of commands from the command.txt file.
orientdb> console.bat commands.txt
在批处理模式下,通过将“ignoreErrors”变量设置为 true,可以忽略错误,让脚本继续执行。
In batch mode, you can ignore errors to let the script continue the execution by setting the "ignoreErrors" variable to true.
orientdb> set ignoreErrors true
Enable Echo
在管道中运行控制台命令时,你需要显示它们。在开始的时候将“echo”设置为属性,即可启用“echo”命令。以下是 OrientDB 控制台中启用 echo 属性的语法。
When you run console commands in pipeline, you will need to display them. Enable "echo" of commands by setting it as property at the beginning. Following is the syntax to enable echo property in OrientDB console.
orientdb> set echo true