当我要创建新字段并从MODEL创建他们的关系时,它会创建多个具有相同名称的字段并从MODEL创建他们的关系。
在执行之前,下面的Cypher语句是cypher语句。
Match (XYZ_Security:MODEL { NodeID: '8e21d265-ae61-4fbe-9664-d4c8177c5792' })
SET XYZ_Security.Name = 'XYZ_Security',
XYZ_Security.IsLookup = 'True',
XYZ_Security.NodeID = '8e21d265-ae61-4fbe-9664-d4c8177c5792'
WITH 1 AS IGNORED
Match (CUSIP:FIELD { NodeID: '92bce26d-5957-4a2c-9ee7-adcf6f5f3a46' })
SET CUSIP.Name = 'CUSIP',
CUSIP.IsKeyMember = 'False',
CUSIP.IsValueMember = 'False',
CUSIP.DataType = 'string',
CUSIP.LookupItem = '',
CUSIP.ValidationExpressionText = 'CUSIP != null',
CUSIP.ValidationExpressionValue = 'true',
CUSIP.NodeID = '92bce26d-5957-4a2c-9ee7-adcf6f5f3a46'
WITH 1 AS IGNORED
Match (ISIN:FIELD { NodeID: 'c0c15fb2-6535-4a23-9c3d-757e35fef063' })
SET ISIN.Name = 'ISIN',
ISIN.IsKeyMember = 'False',
ISIN.IsValueMember = 'False',
ISIN.DataType = 'string',
ISIN.LookupItem = '',
ISIN.ValidationExpressionText = 'ISIN != null',
ISIN.ValidationExpressionValue = 'true',
ISIN.NodeID = 'c0c15fb2-6535-4a23-9c3d-757e35fef063'
WITH 1 AS IGNORED
Match (CurrencyCode:FIELD { NodeID: 'b7bde796-36c1-4d0a-b972-bcc73a4112cd' })
SET CurrencyCode.Name = 'CurrencyCode',
CurrencyCode.IsKeyMember = 'False',
CurrencyCode.IsValueMember = 'False',
CurrencyCode.DataType = 'Lookup',
CurrencyCode.LookupItem = 'Currency',
CurrencyCode.ValidationExpressionText = 'CurrencyCode != null',
CurrencyCode.ValidationExpressionValue = 'true',
CurrencyCode.NodeID = 'b7bde796-36c1-4d0a-b972-bcc73a4112cd'
WITH 1 AS IGNORED
Match (Country:FIELD { NodeID: 'b7bde796-36c1-4d0a-b972-bcc73a4112cd' })
SET Country.Name = 'Country',
Country.IsKeyMember = 'False',
Country.IsValueMember = 'False',
Country.DataType = 'Lookup',
Country.LookupItem = 'Currency',
Country.ValidationExpressionText = 'CurrencyCode != null',
Country.ValidationExpressionValue = 'true',
Country.NodeID = 'b7bde796-36c1-4d0a-b972-bcc73a4112cd'
WITH 1 AS IGNORED
MATCH (XYZ_Security:FIELD)
WHERE XYZ_Security.NodeID IN ['4ba763fb-dd53-4cc4-a151-61e0b2fc364c']
OPTIONAL MATCH (XYZ_Security) <-[r]-(x)
DELETE XYZ_Security, r
WITH 1 AS IGNORED
Match (XYZ_Security:MODEL { NodeID: '8e21d265-ae61-4fbe-9664-d4c8177c5792' })
Create (CADIS_ID_SEC:FIELD { Name: 'CADIS_ID_SEC',
IsKeyMember: 'False', IsValueMember: 'False', DataType: 'Lookup',
LookupItem: 'CADIS_ID_SEC',
ValidationExpressionText: 'CADIS_ID_SEC != null',
ValidationExpressionValue: 'true',
NodeID: '5fe062aa-7d47-451e-b091-8cc4a4c8c181' })
Create (XYZ_Security)-[:HAS_FIELD]->(CADIS_ID_SEC)
执行上面的cypher语句后,它会添加多个具有相同名称的FIELD,并添加它们与MODEL的关系。执行cypher语句后,请参阅下面的屏幕截图。