Features
A cypher query language formatter.
Please using Cypher QL
extension accompany with this extension.
With a button - Copy Cypher
to indent cypher into a single line and copy to clipboard.
Requirements
Install Cypher QL
from extension market first, then select Cypher QL
as language.
Extension Settings
Use command opt+shift+f
to format your document.
CALL {
MATCH (type1:`type1` { fieldName: 'fieldValue', type: 'type1' })
WITH type1
MATCH (type1:`type1`)-[:`RELATES_TO` { fieldName: 'a' }]->(type2:`type2` { fieldName: 'fieldValue' })
WHERE type2.fieldName2 = 'xxxxx'
RETURN DISTINCT type1
UNION
MATCH (type1:`type1` { fieldName: 'fieldValue', type: 'type1' })
WITH type1
MATCH (type1:`type1`)-[:`RELATES_TO` { fieldName: 'dd' }]->(type2:`type2` { fieldName: 'fieldValue' })
WHERE type2.fieldName2 = 'xxxxx'
RETURN DISTINCT type1
UNION
MATCH (type1:`type1` { fieldName: 'fieldValue', type: 'type1' })
WITH type1
MATCH (type1:`type1`)-[:`RELATES_TO` { fieldName: 'oneName' }]->(type3:`type3` { fieldName: 'fieldValue' })
WHERE type3.fieldName3 = 'xxxxx'
RETURN DISTINCT type1
UNION
MATCH (type1:`type1` { fieldName: 'fieldValue', type: 'type1' })
WITH type1
MATCH (type1:`type1`)-[:`RELATES_TO` { fieldName: 'xx' }]->(type2:`type2` { fieldName: 'fieldValue' })
WHERE type2.name = 'xxxxx'
RETURN DISTINCT type1
UNION
MATCH (type1:`type1` { fieldName: 'fieldValue', type: 'type1' })
WITH type1
MATCH (type1:`type1`)-[:`RELATES_TO` { fieldName: 'd' }]->(type2:`type2` { fieldName: 'fieldValue' })
WHERE type2.name = 'xxxxx'
RETURN DISTINCT type1
}
WITH * type1 BY type1.type1Identifier ASC, id(type1) ASC
RETURN type1{ .*, _id: id(type1)} LIMIT 21
MATCH (type1:`type1` {field1: 'value1', type: 'type1'})
WHERE (type1.deleted = false OR type1.deleted IS null )
CALL {
WITH type1
MATCH
(type2:`type2`)-[:`RELATES_TO` {fieldName: 'type3'}]->(type3:`type3`),
(type2:`type2`)-[:`RELATES_TO` {fieldName: 'type4'}]->(type4:`type4`),
(type1:`type1`)-[:`RELATES_TO` {fieldName: 'type3'}]->(type3:`type3`),
(type1)-[:`RELATES_TO` {fieldName: 'type4'}]->(type4:`type4`)
WHERE type2.startDate = '2022-03-18'
WITH DISTINCT type2 ORDER BY id(type2) ASC
CALL {
WITH type2
MATCH (type2:`type2`)-[:`RELATES_TO` {fieldName: 'type3'}]->(type3:`type3` {field1: 'value1'})
WITH DISTINCT type3 ORDER BY id(type3) ASC
WITH collect(type3{.*, _id: id(type3)})[0..6] AS collectionAlias, count(type3) AS countAlias
RETURN {dataList: collectionAlias, totalCount: countAlias} AS type2_type3_type3_info
}
CALL {
WITH type2
MATCH (type2:`type2`)-[:`RELATES_TO` {fieldName: 'type4'}]->(type4:`type4` {field1: 'value1'})
WITH DISTINCT type4 ORDER BY id(type4) ASC
WITH collect(type4{.*, _id: id(type4)})[0..6] AS collectionAlias, count(type4) AS countAlias
RETURN {dataList: collectionAlias, totalCount: countAlias} AS type2_type4_type4_info
}
WITH collect(type2{.*, _id: id(type2), type3: type2_type3_type3_info, type4: type2_type4_type4_info})[0..6] AS collectionAlias, count(type2) AS countAlias
RETURN {dataList: collectionAlias, totalCount: countAlias} AS type1_type2_alias2_info
}
CALL {
WITH type1
MATCH
(type2:`type2`)-[:`RELATES_TO` {fieldName: 'type3'}]->(type3:`type3`),
(type2:`type2`)-[:`RELATES_TO` {fieldName: 'type4'}]->(type4:`type4`),
(type1:`type1`)-[:`RELATES_TO` {fieldName: 'type3'}]->(type3:`type3`),
(type1)-[:`RELATES_TO` {fieldName: 'type4'}]->(type4:`type4`)
WITH DISTINCT type2 ORDER BY id(type2) ASC
WITH collect(type2{.*, _id: id(type2)})[0..6] AS collectionAlias, count(type2) AS countAlias
RETURN {dataList: collectionAlias, totalCount: countAlias} AS type1_type2_alias3_info
}
RETURN type1{.*, _id: id(type1), `alias2:joinReferences`: type1_type2_alias2_info, `alias3:joinReferences`: type1_type2_alias3_info} LIMIT 6