0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

cypher queryの使い方メモ(自分用)

Last updated at Posted at 2019-04-12

#ノードの登録(CREATE)

基本編

#####CREATE (ノード[:ラベル]{属性名:属性内容,・・・・})

CREATE (n:Person)
⇒ノードにPersonというラベルが付いたノードが作られる

CREATE (n:Person:admin)
⇒ノードにPerson,adminというラベルが付いたノードが作られる

CREATE (n:Person{name:"taro"})
⇒ノードにPersonというラベル、name属性にtaroを持ったノードが作られる

CREATE (n:Person{name:"taro",age:"33"})
⇒属性は何個でも登録できる

CREATE (n:Person{name:"taro"}),(m:Person{name:"jiro"})
⇒複数のノード登録

関係

CREATE (n:Person{name:"taro"})-[r:FRIEND]->(m:Person{name:"jiro"})
taroとjiroが友達(taroは友達と思ってるけど、jiroは友達と思っていない。ひどい)

MATCH (n:Person{name:"taro"}),(m:Person{name:"jiro"}) CREATE UNIQUE (n)<-[r:FRIEND]->(m)
⇒UNIQUEは1回だけ関係を作る。<>は関係を作りたい方向

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?