我必须将此 mongoDB 文档转换为 neo4j。这是一个文档示例:
{
"_id" : "Atl.02",
"official_name" : "Club Atletico de Madrid S.A.D.",
"common_name" : "Atletico Madrid",
"country" : "Spain",
"started_by" : {
"day" : 26,
"month" : 4,
"year" : 1903
},
"stadium" : {
"name" : "Vicente Calderón",
"capacity" : 54907
},
"palmarès" : {
"La Liga" : 10,
"Segunda Division" : 1,
"Copa del Rey" : 10,
"Supercopa de Espana" : 2,
"UEFA Europa League" : 2,
"UEFA Cup Winners Cup" : 1,
"UEFA Super Cup" : 2,
"FIFA Club World cup" : 1
},
"uniform" : "blue, white and red"
}
我创建了一个团队节点:
CREATE (n:team {_id:"Atl.02", official_name:"Club Atletico de Madrid S.A.D.",
common_name:"Atletico Madrid", country:"Spain",
started_by_day: 26, started_by_month:4, started_by_year:1903,
uniform:"blue, white and red"})
一个体育场节点:
CREATE (n:stadium {name:"Vicente Calderòn", capacity:54907})
球队与球场的关系:
MATCH (n:team), (n1:stadium) WHERE n._id="Atl.02" AND
n1.name="Vicente Calderòn" CREATE n-[r:PLAYS]->n1
这是一张图片:
首先是:
如何转换palmarès的信息?
我想到了两种可能:
1)把这些信息放在团队节点中
2)创建一个新节点,叫做palmarès,并设置关系上的属性
你怎么看?又如何从信息开始?放在团队节点是不是一个不错的选择?