ArangoDB入门教程(二)web端介绍

  1. 与其他数据库一样,数据库ArangoDB的web端使用比较直观,方便,下面,介绍一下ArangoDB的web端。
  2. 首先在浏览器上输入:  http://127.0.0.1:8529  ,如果没有设置密码,就可以得到

 

ArangoDB入门教程(二)web端介绍_第1张图片

 

     我们输入用户名和密码就好,密码可设可不设,选择进入AQLTest或者_System就好

ArangoDB入门教程(二)web端介绍_第2张图片

 

我们进入_System,点击进入,看左边的列表:

COLLECTIONS:集合,里边包含文本数据模型和键值(Key-Value)存储数据模型;

QUERES: 使用AQL语句操作COLLECTIONS里边的数据库等;

GRAPHS:图形数据库部分;

其他的就不说了

 

ArangoDB入门教程(二)web端介绍_第3张图片

 

 

点击COLLECTIONS,我们点击左边的“Add Collection”,添加表“uesrs”就好

 

ArangoDB入门教程(二)web端介绍_第4张图片

 

    点击QUERIES,如下图输入以下代码,点击右下角绿色的Execute,数据就输入进去了,save as 还可以保存这个指令

For user IN [ 
   {
    "_rev": "_VlR_kJ6--I",
    "name": "securityScanning",
    "function": "安全扫描",
    "createAt": 1503295312,
    "updateAt": 1504171776,
    "status": "active",
    "params": {
      "feedback": "安全扫描",
      "function": "安全扫描",
      "keyword": "launch"
    },
    "formatName": "SECURITYSCANNING",
    "formatNames": [
      "安全扫描",
      "SECURITYSCANNING"
    ],
    "label": "appservice"
  },
  {
    "_rev": "_VlR_kJ6--Y",
    "name": "networkSpeed",
    "function": "打开实时网速",
    "createAt": 1503295312,
    "updateAt": 1504171776,
    "status": "active",
    "params": {
      "feedback": "打开实时网速",
      "function": "打开实时网速",
      "extra": [
        {
          "name": "VoiceCmd",
          "type": "S",
          "value": "START_REAL_NET_DISPLAY_BY_VOICE"
        }
      ],
      "keyword": "broadcast"
    },
    "formatName": "NETWORKSPEED",
    "formatNames": [
      "NETWORKSPEED",
      "打开实时网速"
    ],
    "label": "appservice"
  },

  {
    "_rev": "_VlR_kJ6--B",
    "name": "systemInformation",
    "function": "系统配置",
    "createAt": 1503295312,
    "updateAt": 1503295312,
    "status": "active",
    "formatName": "SYSTEMINFORMATION",
    "formatNames": [
      "SYSTEMINFORMATION",
      "系统配置"
    ],
    "label": "appservice"
  }
]
 INSERT user INTO users

 

如图

ArangoDB入门教程(二)web端介绍_第5张图片

其他的指令

 

增:

增加一个文档:
INSERT { name: "John Doe", gender: "m" } 
  INTO users
  
增加一个集合:
FOR user IN [ 
  { name: "John Doe", age: "10" }, 
  { name: "Jane Smith", age: "20" } ,
  { name: "Mo Yang", age: "40" } ,
  { name: "Da Ming", age: "60" } 
]
  INSERT user INTO users
  
增加一个表:
FOR user IN users
  FILTER user.active == 1
  INSERT user INTO users

查和更新:

   
查: 
查全部:
   FOR user IN users
  RETURN users
过滤查询:
  FOR user IN users
  FILTER user.name	==	"networkSpeed"	
  RETURN users
排序查询:
FOR user IN users
  SORT user.name, user.function
  RETURN users

更新(_key要更改,查看自己的):
更新一个:
UPDATE { _key : 692971 }
  WITH { updateAt: "1504171776" }
  IN users
  

返回:

返回一个:
FOR	user	IN	users
RETURN	{	nameame:	user.name,	function:	user.function	}
返回打印:
FOR	user
IN	users	 
RETURN	CONCAT(user.name,	" 's   function 	is' ",	user.function)
排序返回:
FOR	user	IN	users		
SORT	user.age	DESC		
RETURN	users
过滤排序返回:
FOR	user
IN	users
FILTER user.name	==	"networkSpeed"	
SORT user.name, user.function	 
RETURN	CONCAT(user.name,	" 's   function 	is' ",	user.function)
比较返回:
FOR	user1	IN	users	
FOR	user2	IN	users		
FILTER	user1	!=	user2	
RETURN	{						
pair:	[user1.name,	user2.name],	
sumOfAges:	user1.age	+	user2.age	
}
综合返回:
FOR	user1	IN	users	
FOR	user2	IN	users	
FILTER	user1	!=	user2		
LET	sumOfAges	=	user1.age	+	user2.age	
FILTER	sumOfAges	>	40		
RETURN	{							
pair:	[user1.name,	user2.name],	
sumOfAges:	sumOfAges				}

删除:

删一个: 
   FOR	user
IN	users		
FILTER	user.name	==	"networkSpeed"	
REMOVE	user	IN	users
替换:
REPLACE { _key: "1" }
  WITH {
    name: "Jane Smith",
    gender: "f"
  }
  IN users
删全部:
FOR user IN users
   REMOVE user IN users



希望以上对你有所帮助!

 

 

 

 

 

 

 

你可能感兴趣的:(ArangoDB,知识图谱)