diff --git a/package-lock.json b/package-lock.json index 74c49bc..ebf19cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -348,8 +348,8 @@ }, "@babel/plugin-proposal-class-properties": { "version": "7.8.3", - "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz", - "integrity": "sha1-XgZlSvXNBLYIkVqtqbKmeIAERk4=", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz", + "integrity": "sha512-EqFhbo7IosdgPgZggHaNObkmO1kNUe3slaKu54d5OWvy+p9QIKOzK1GAEpAIsZtWVtPXUHSMcT4smvDrCfY4AA==", "requires": { "@babel/helper-create-class-features-plugin": "^7.8.3", "@babel/helper-plugin-utils": "^7.8.3" @@ -3551,6 +3551,11 @@ "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk=", "dev": true }, + "antlr4": { + "version": "4.7.0", + "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/antlr4/-/antlr4-4.7.0.tgz", + "integrity": "sha1-KX+VbdwG+DOX/AmQ7PLgzyC/u+4=" + }, "any-observable": { "version": "0.3.0", "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/any-observable/-/any-observable-0.3.0.tgz", @@ -5799,6 +5804,24 @@ "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/cyclist/-/cyclist-1.0.1.tgz", "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=" }, + "cypher-codemirror": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/cypher-codemirror/-/cypher-codemirror-1.1.6.tgz", + "integrity": "sha512-f4sRbFXh3ElWxQm4TUX8stcbRDA2iVabdpu8VvWoR6o/vauC1xx2VBE0u/qY2uCysy1uphRBuvjCC883ruT3ng==", + "requires": { + "cypher-editor-support": "1.1.6" + } + }, + "cypher-editor-support": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/cypher-editor-support/-/cypher-editor-support-1.1.6.tgz", + "integrity": "sha512-cmhPMcNTVARXK2jiljcqoD6u6qMlplFWkMrKxuIOnWtAYooWqh63P7tOrfdN3nydPS+dAplsM+B9z5GOv1Kqdw==", + "requires": { + "antlr4": "4.7.0", + "fuzzaldrin": "2.1.0", + "lodash": "4.17.15" + } + }, "d": { "version": "1.0.1", "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/d/-/d-1.0.1.tgz", @@ -7762,6 +7785,11 @@ "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, + "fuzzaldrin": { + "version": "2.1.0", + "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/fuzzaldrin/-/fuzzaldrin-2.1.0.tgz", + "integrity": "sha1-kCBMPi/appQbso0WZF1BgGOpDps=" + }, "gensync": { "version": "1.0.0-beta.1", "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/gensync/-/gensync-1.0.0-beta.1.tgz", @@ -10879,8 +10907,7 @@ "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" }, "lodash.isstring": { "version": "4.0.1", @@ -17326,11 +17353,6 @@ "section-iterator": "^2.0.0" } }, - "react-codemirror2": { - "version": "7.1.0", - "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/react-codemirror2/-/react-codemirror2-7.1.0.tgz", - "integrity": "sha1-uHSida1Pby7lrbI7VQwPS4uCd20=" - }, "react-cookie": { "version": "4.0.3", "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/react-cookie/-/react-cookie-4.0.3.tgz", @@ -17600,6 +17622,18 @@ "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/react-is/-/react-is-16.13.1.tgz", "integrity": "sha1-eJcppNw23imZ3BVt1sHZwYzqVqQ=" }, + "react-redux": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.0.tgz", + "integrity": "sha512-EvCAZYGfOLqwV7gh849xy9/pt55rJXPwmYvI4lilPM5rUT/1NxuuN59ipdBksRVSvz0KInbPnp4IfoXJXCqiDA==", + "requires": { + "@babel/runtime": "^7.5.5", + "hoist-non-react-statics": "^3.3.0", + "loose-envify": "^1.4.0", + "prop-types": "^15.7.2", + "react-is": "^16.9.0" + } + }, "react-scripts": { "version": "3.4.1", "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/react-scripts/-/react-scripts-3.4.1.tgz", @@ -17810,6 +17844,23 @@ "esprima": "~4.0.0" } }, + "redux": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.0.5.tgz", + "integrity": "sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==", + "requires": { + "loose-envify": "^1.4.0", + "symbol-observable": "^1.2.0" + } + }, + "redux-mock-store": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/redux-mock-store/-/redux-mock-store-1.5.4.tgz", + "integrity": "sha512-xmcA0O/tjCLXhh9Fuiq6pMrJCwFRaouA8436zcikdIpYWWCjU76CRk+i2bHx8EeiSiMGnB85/lZdU3wIJVXHTA==", + "requires": { + "lodash.isplainobject": "^4.0.6" + } + }, "regenerate": { "version": "1.4.0", "resolved": "https://inditex.jfrog.io/inditex/api/npm/node-public/regenerate/-/regenerate-1.4.0.tgz", diff --git a/package.json b/package.json index 4f440cf..73e5cfb 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "dependencies": { "@adrianiy/react-autosuggest": "^10.0.1", "@babel/core": "^7.1.2", - "@babel/plugin-proposal-class-properties": "^7.1.0", + "@babel/plugin-proposal-class-properties": "^7.8.3", "@babel/plugin-transform-regenerator": "^7.0.0", "@babel/preset-env": "^7.1.0", "@babel/preset-react": "^7.0.0", @@ -14,6 +14,7 @@ "@testing-library/user-event": "^7.2.1", "@typescript-eslint/parser": "^2.28.0", "codemirror": "^5.52.2", + "cypher-codemirror": "^1.1.6", "d3": "3", "deepmerge": "^4.2.2", "husky": "^4.2.5", @@ -21,12 +22,14 @@ "lint-staged": "^10.1.3", "neo4j-driver": "^4.0.2", "react": "^16.13.1", - "react-codemirror2": "^7.1.0", "react-cookie": "^4.0.3", "react-dom": "^16.13.1", + "react-redux": "^7.2.0", "react-scripts": "3.4.1", "react-suber": "1.0.4", "react-svg-inline": "^2.1.1", + "redux": "^4.0.5", + "redux-mock-store": "^1.5.4", "styled-components": "^5.1.0", "typescript": "^3.8.3", "url-parse": "^1.4.7", diff --git a/src/App.css b/src/App.css index fe7e574..248551d 100644 --- a/src/App.css +++ b/src/App.css @@ -2,6 +2,9 @@ background-color: var(--bg-color); color: var(--text-color); min-height: 100vh; + position: fixed; + top: 0; + width: 100%; display: flex; flex-direction: column; align-items: center; diff --git a/src/App.js b/src/App.js index f6c1fc2..7f70826 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,5 @@ import React, { useState, useEffect, useCallback } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; import { useCookies } from 'react-cookie'; import Login from './components/login/Login'; @@ -6,23 +7,22 @@ import Comander from './components/comander/Comander'; import Header from './components/header/Header'; import { doLogout } from './service/neo.service'; -import { themes, manageAutoTheme, ThemeContext } from './global/utils/hooks/theme'; import { cls } from './global/utils'; import './App.css'; +import allActions from './global/utils/store/actions'; function App() { const [cookies, setCookie] = useCookies(["neo4jDash.sess"]); - const [sessionId, setSessionId] = useState(null); - const [user, setUser] = useState(''); const [loading, setLoading] = useState(true); - const [theme, setTheme] = useState(() => manageAutoTheme('auto')); + const [theme, user] = useSelector(state => [state.currentTheme, state.currentUser]); + + const dispatch = useDispatch(); const loginHandler = useCallback((response) => { setCookie("neo4jDash.sess", JSON.stringify(response)); - setSessionId(response.sessionId); - setUser(response.user); - }, [setCookie]); + dispatch(allActions.userActions.setUser(response)); + }, [dispatch, setCookie]); useEffect(() => { if (cookies["neo4jDash.sess"] && cookies["neo4jDash.sess"].sessionId && loading) { @@ -31,42 +31,38 @@ function App() { setLoading(false); }, [cookies, loading, loginHandler, theme]); - const logoutHandler = () => { - logout(); - } - - const logout = async () => { - const logOutResult = await doLogout(sessionId); - if (logOutResult) { - setSessionId(null); - setCookie('neo4jDash.sess', null); + useEffect(() => { + if (!loading && !user.loggedIn) { + async function logout() { + await doLogout(user.sessionId); + } + logout(); + setCookie("neo4jDash.sess", null); } - } + }, [loading, setCookie, user]); const render = () => { if (loading) { return share } else { - if (!sessionId) { + if (!user.loggedIn) { return ( ) } else { return (
-
- +
+
) } } } - return -
+ return
{ render() }
- } export default App; diff --git a/src/App.test.js b/src/App.test.js index 92a0486..54566d2 100644 --- a/src/App.test.js +++ b/src/App.test.js @@ -1,9 +1,18 @@ import React from 'react'; import { render } from '@testing-library/react'; import App from './App'; +import { setup } from './global/utils/tests/store.mock'; + +describe('App test suite', () => { + beforeAll(() => { + + }) + + test('renders login button if user is not logged in', () => { + const { MockProvider } = setup({ currentTheme: {}, currentUser: { loggedIn: false } }); + const { getByText } = render(); + const linkElement = getByText("Login"); + expect(linkElement).toBeDefined(); + }); +}) -test('renders learn react link', () => { - const { getByText } = render(); - const linkElement = getByText("Login"); - expect(linkElement).toBeDefined(); -}); diff --git a/src/components/card/Card.js b/src/components/card/Card.js index 2f4813d..ae08982 100644 --- a/src/components/card/Card.js +++ b/src/components/card/Card.js @@ -1,4 +1,4 @@ -import React, { useState, useCallback, useRef, useEffect, useContext } from 'react'; +import React, { useState, useCallback, useRef, useEffect } from 'react'; import Summary from './Summary'; import { getChart } from '../../service/neo.service'; @@ -8,7 +8,7 @@ import Chart from '../../global/components/chart/Chart'; import { cls } from '../../global/utils'; import styles from './Card.module.css'; import neoGraphStyle from '../../global/components/chart/graphStyle'; -import { ThemeContext } from '../../global/utils/hooks/theme'; +import { useSelector } from 'react-redux'; const graphStyle = new neoGraphStyle(); @@ -20,7 +20,7 @@ function Card(props) { const [stats, setStats] = useState(null); const [expanded, setExpanded] = useState(false); const [fullscreen, setFullscreen] = useState(false); - const theme = useContext(ThemeContext) + const [theme, user] = useSelector(state => [state.currentTheme, state.currentUser]); const [graphStyleData, setGraphStyle] = useState({ relationship: { 'text-color-external': theme.relColor @@ -39,13 +39,13 @@ function Card(props) { const fecthData = useCallback(async () => { try { - const results = await getChart(props.sessionId, props.query); + const results = await getChart(user.sessionId, props.query); setResults(results); setError(null); } catch (err) { setError(`${ props.query }: ${err}`); } - }, [props]) + }, [props.query, user.sessionId]) useEffect(() => { if (query.current !== props.query) { @@ -124,7 +124,6 @@ function Card(props) { style={{ width: "100%" }} result={results} maxNeighbours={30} - sessionId={props.sessionId} itemHovered={itemHover} itemSelected={itemSelected} setSummary={setSummary} diff --git a/src/components/comander/Comander.js b/src/components/comander/Comander.js index d5f7c8c..5a1b1f3 100644 --- a/src/components/comander/Comander.js +++ b/src/components/comander/Comander.js @@ -1,17 +1,15 @@ -import React, { useState, useRef, useEffect, useContext } from 'react'; -import { Controlled as CodeMirror } from "react-codemirror2"; +import React, { useState, useRef, useEffect } from 'react'; +import { useSelector } from 'react-redux'; import Timeline from '../timeline/Timeline'; -import "codemirror/lib/codemirror.css"; -import "codemirror/theme/material.css"; -import "codemirror/mode/cypher/cypher"; -import "./codemirror.css"; +import CypherCodeMirror from './CypherCodeMirror'; + +import { codeMirrorSettings, neo4jSchema } from './cypher/common'; import { cls, concatUniqueStrings } from '../../global/utils'; import { RowLayout, ColumnLayout } from '../../global/layouts'; import { useEventListener } from "../../global/utils/hooks/events"; import styles from './Comander.module.css'; -import { ThemeContext } from '../../global/utils/hooks/theme'; function Comander(props) { @@ -20,8 +18,16 @@ function Comander(props) { const [showStored, setShowStored] = useState(false); const [highlightedSuggestion, setHighlightedSuggestion] = useState(-1); const [fullscreen, setFullscreen] = useState(false); + const [editor, setEditor] = useState(null); + const cm = useRef(null); const storedQueries = useRef([]); - const theme = useContext(ThemeContext); + const theme = useSelector(state => state.currentTheme); + + useEffect(() => { + if (editor) { + cm.current = editor.getCodeMirror(); + } + }, [editor]) useEffect(() => { const queries = localStorage.getItem("neo4jDashboard.queries"); @@ -40,6 +46,7 @@ function Comander(props) { setQuery(""); setShowStored(false); storedQueries.current = stored; + cm.current.setValue(""); localStorage.setItem("neo4jDashboard.queries", JSON.stringify(stored)); }; @@ -47,9 +54,12 @@ function Comander(props) { setShowStored(!showStored); }; - const selectQuery = (query) => { + const selectQuery = (event, query) => { + event.preventDefault(); setQuery(query); setShowStored(false); + cm.current.setValue(query); + cm.current.setCursor(cm.current.lineCount(), 0); }; const deleteQuery = (query) => { @@ -78,20 +88,16 @@ function Comander(props) { }); return ( - - - + + { - setQuery(value); - }} + options={{ ...codeMirrorSettings, ...{ theme: theme.codemirror } }} + schema={neo4jSchema} + defaultValue={""} + onChange={(value) => setQuery(value)} + onParsed={() => null} + ref={(el) => setEditor(el)} /> play_arrow @@ -101,23 +107,22 @@ function Comander(props) {
-
Últimas consultas
    {storedQueries.current.map((q, i) => (
  • selectQuery(q)} + onClick={e => selectQuery(e, q)} className={highlightedSuggestion === i ? styles.suggestionActive : ""} > -
  • ))} @@ -127,7 +132,6 @@ function Comander(props) { queries={queries} selectQuery={selectQuery} deleteQuery={deleteQuery} - sessionId={props.sessionId} toggleFullScreen={toggleFullScreen} /> diff --git a/src/components/comander/Comander.module.css b/src/components/comander/Comander.module.css index 4ecd070..f5ab07b 100644 --- a/src/components/comander/Comander.module.css +++ b/src/components/comander/Comander.module.css @@ -53,6 +53,7 @@ } .list ul { max-height: calc(100% - 40px); + width: calc(100% + 24px); overflow: scroll; margin: 0; padding: 0; @@ -64,22 +65,14 @@ line-height: 40px; display: block; } -.listOverflow { - position: absolute; - right: 0; - top: 0; - height: 100%; - width: 14px; - background:var(--third-color); - z-index: 2; -} .list li { list-style: none; cursor: pointer; margin: 0; padding: 8px 24px; + padding-right: 48px; cursor: pointer; - transition: all ease-in-out 300ms; + transition: all ease-in-out 100ms; } .list li:hover { background: var(--highlight-secondary); diff --git a/src/components/comander/CypherCodeMirror.js b/src/components/comander/CypherCodeMirror.js new file mode 100644 index 0000000..a7d5eb8 --- /dev/null +++ b/src/components/comander/CypherCodeMirror.js @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2002-2017 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* eslint-disable no-console */ +import * as React from 'react'; +import { createCypherEditor, parse } from 'cypher-codemirror' + +import "codemirror/lib/codemirror.css"; +import "codemirror/addon/lint/lint"; +import "codemirror/addon/lint/lint.css"; +import "codemirror/addon/hint/show-hint"; +import "codemirror/addon/edit/closebrackets"; + +import "cypher-codemirror/src/codemirror-cypher.css"; + +import './codemirror.css' +import { cls, debounce } from '../../global/utils'; + +function triggerAutocompletion(cm, changed) { + if (changed.text.length !== 1) { + return; + } + + const text = changed.text[0]; + const shouldTriggerAutocompletion = + text === '.' || + text === ':' || + text === '[]' || + text === '()' || + text === '{}' || + text === '[' || + text === '(' || + text === '{' || + text === '$'; + if (shouldTriggerAutocompletion) { + cm.execCommand('autocomplete'); + } +} + +export default class CodeMirror extends React.Component { + lastChange = null; + constructor(props) { + super(props); + this.state = { + isFocused: false, + }; + } + + componentDidMount() { + this.debouncedOnParse = debounce(this.onParsed, 300, this); + const textareaNode = this.editorReference; + const { editor, editorSupport } = createCypherEditor(textareaNode, this.props.options); + this.codeMirror = editor; + this.codeMirror.on("change", this.codemirrorValueChange); // Triggered before DOM update + this.codeMirror.on("changes", this.codemirrorValueChanges); // Triggered after DOM update + this.codeMirror.on("focus", this.focusChanged.bind(this, true)); + this.codeMirror.on("blur", this.focusChanged.bind(this, false)); + this.codeMirror.on("scroll", this.scrollChanged.bind(this)); + this.codeMirror.setValue(this.props.defaultValue || this.props.value || ""); + this.editorSupport = editorSupport; + this.editorSupport.setSchema(this.props.schema); + + if (this.props.initialPosition) { + this.goToPosition(this.props.initialPosition); + } + } + + goToPosition(position) { + for (let i = 0; i < position.line; i++) { + this.codeMirror.execCommand("goLineDown"); + } + + for (let i = 0; i <= position.column; i++) { + this.codeMirror.execCommand("goCharRight"); + } + } + + componentDidUpdate(prevProps) { + if (typeof this.props.options === "object") { + for (const optionName in this.props.options) { + if (this.props.options.hasOwnProperty(optionName)) { + this.codeMirror.setOption(optionName, this.props.options[optionName]); + } + } + } + if (this.props.schema) { + this.editorSupport.setSchema(prevProps.schema); + } + if (prevProps.value !== this.props.value && this.props.value) { + this.codeMirror.setValue(this.props.value); + } + } + + getCodeMirror() { + return this.codeMirror; + } + + generateStatementsFromCurrentValue() { + const parsed = parse(this.codeMirror.getValue()); + const { queriesAndCommands } = parsed.referencesListener; + return queriesAndCommands; + } + + focus() { + if (this.codeMirror) { + this.codeMirror.focus(); + } + } + + focusChanged(focused) { + this.setState({ + isFocused: focused, + }); + this.props.onFocusChange && this.props.onFocusChange(focused); + } + + scrollChanged(cm) { + this.props.onScroll && this.props.onScroll(cm.getScrollInfo()); + } + + codemirrorValueChange = (doc, change) => { + this.lastChange = change; + triggerAutocompletion(doc, change); + if (this.props.onChange && change.origin !== "setValue") { + this.props.onChange(doc.getValue(), change); + } + this.debouncedOnParse(); + }; + + codemirrorValueChanges = (doc, change) => { + if (this.props.onChanges && change.origin !== "setValue") { + this.props.onChanges(doc.getValue(), change); + } + }; + + onParsed = () => { + this.props.onParsed && this.props.onParsed(this.generateStatementsFromCurrentValue(), this.lastChange); + }; + + render() { + const editorClassNames = cls( + "ReactCodeMirror", + this.state.isFocused ? "ReactCodeMirror--focused" : '', + this.props.className + ); + + const setEditorReference = (ref) => { + this.editorReference = ref; + }; + return
    ; + } +} diff --git a/src/components/comander/codemirror.css b/src/components/comander/codemirror.css index 639e4f2..bc72f23 100644 --- a/src/components/comander/codemirror.css +++ b/src/components/comander/codemirror.css @@ -1,10 +1,20 @@ .CodeMirror { height: auto; - padding: 4px; cursor: text; border-radius: 4px; + padding: 4px; +} +.CodeMirror.CodeMirror-wrap.cm-s-cypher.cm-s-cypher-light { + background-color: #fff; +} +.cm-s-cypher.cm-s-cypher .CodeMirror-gutters { + background: transparent; + border-right: none; +} +.cm-s-cypher .CodeMirror-cursor { + z-index: 3 !important; + border-left: 11px solid rgba(155, 157, 162, 0.37) !important; } - ul .CodeMirror-lines { cursor: pointer; } diff --git a/src/components/comander/cypher/_data/functions.json b/src/components/comander/cypher/_data/functions.json new file mode 100644 index 0000000..a0e38c4 --- /dev/null +++ b/src/components/comander/cypher/_data/functions.json @@ -0,0 +1 @@ +{"columns":["name","signature","description","roles"],"data":[{"row":["apoc.coll.avg","apoc.coll.avg(numbers :: LIST? OF NUMBER?) :: (FLOAT?)","apoc.coll.avg([0.5,1,2.3])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.contains","apoc.coll.contains(coll :: LIST? OF ANY?, value :: ANY?) :: (BOOLEAN?)","apoc.coll.contains(coll, value) optimized contains operation (using a HashSet) (returns single row or not)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.containsAll","apoc.coll.containsAll(coll :: LIST? OF ANY?, values :: LIST? OF ANY?) :: (BOOLEAN?)","apoc.coll.containsAll(coll, values) optimized contains-all operation (using a HashSet) (returns single row or not)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.containsAllSorted","apoc.coll.containsAllSorted(coll :: LIST? OF ANY?, values :: LIST? OF ANY?) :: (BOOLEAN?)","apoc.coll.containsAllSorted(coll, value) optimized contains-all on a sorted list operation (Collections.binarySearch) (returns single row or not)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.containsSorted","apoc.coll.containsSorted(coll :: LIST? OF ANY?, value :: ANY?) :: (BOOLEAN?)","apoc.coll.containsSorted(coll, value) optimized contains on a sorted list operation (Collections.binarySearch) (returns single row or not)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.disjunction","apoc.coll.disjunction(first :: LIST? OF ANY?, second :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.disjunction(first, second) - returns the disjunct set of the two lists",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.indexOf","apoc.coll.indexOf(coll :: LIST? OF ANY?, value :: ANY?) :: (INTEGER?)","apoc.coll.indexOf(coll, value) | position of value in the list",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.intersection","apoc.coll.intersection(first :: LIST? OF ANY?, second :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.intersection(first, second) - returns the unique intersection of the two lists",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.max","apoc.coll.max(values :: LIST? OF ANY?) :: (ANY?)","apoc.coll.max([0.5,1,2.3])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.min","apoc.coll.min(values :: LIST? OF ANY?) :: (ANY?)","apoc.coll.min([0.5,1,2.3])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.pairs","apoc.coll.pairs(list :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.pairs([1,2,3]) returns [1,2],[2,3],[3,null] ",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.pairsMin","apoc.coll.pairsMin(list :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.pairsMin([1,2,3]) returns [1,2],[2,3]",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.removeAll","apoc.coll.removeAll(first :: LIST? OF ANY?, second :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.removeAll(first, second) - returns first list with all elements of second list removed",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.sort","apoc.coll.sort(coll :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.sort(coll) sort on Collections",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.sortMaps","apoc.coll.sortMaps(coll :: LIST? OF MAP?, prop :: STRING?) :: (LIST? OF ANY?)","apoc.coll.sortMaps([maps], 'name') - sort maps by property",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.sortNodes","apoc.coll.sortNodes(coll :: LIST? OF NODE?, prop :: STRING?) :: (LIST? OF ANY?)","apoc.coll.sortNodes([nodes], 'name') sort nodes by property",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.subtract","apoc.coll.subtract(first :: LIST? OF ANY?, second :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.subtract(first, second) - returns unique set of first list with all elements of second list removed",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.sum","apoc.coll.sum(numbers :: LIST? OF NUMBER?) :: (FLOAT?)","apoc.coll.sum([0.5,1,2.3])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.sumLongs","apoc.coll.sumLongs(numbers :: LIST? OF NUMBER?) :: (INTEGER?)","apoc.coll.sumLongs([1,3,3])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.toSet","apoc.coll.toSet(values :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.toSet([list]) returns a unique list backed by a set",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.union","apoc.coll.union(first :: LIST? OF ANY?, second :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.union(first, second) - creates the distinct union of the 2 lists",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.unionAll","apoc.coll.unionAll(first :: LIST? OF ANY?, second :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.unionAll(first, second) - creates the full union with duplicates of the two lists",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.coll.zip","apoc.coll.zip(list1 :: LIST? OF ANY?, list2 :: LIST? OF ANY?) :: (LIST? OF ANY?)","apoc.coll.zip([list1],[list2])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.fromJsonList","apoc.convert.fromJsonList(list :: STRING?) :: (LIST? OF ANY?)","apoc.convert.fromJsonList('[1,2,3]')",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.fromJsonMap","apoc.convert.fromJsonMap(map :: STRING?) :: (MAP?)","apoc.convert.fromJsonMap('{\"a\":42,\"b\":\"foo\",\"c\":[1,2,3]}')",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.getJsonProperty","apoc.convert.getJsonProperty(node :: NODE?, key :: STRING?) :: (ANY?)","apoc.json.getJsonProperty(node,key) - converts serialized JSON in property back to original object",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.getJsonPropertyMap","apoc.convert.getJsonPropertyMap(node :: NODE?, key :: STRING?) :: (MAP?)","apoc.json.getJsonPropertyMap(node,key) - converts serialized JSON in property back to map",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.toBoolean","apoc.convert.toBoolean(bool :: ANY?) :: (BOOLEAN?)","apoc.convert.toBoolean(value) | tries it's best to convert the value to a boolean",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.toJson","apoc.convert.toJson(value :: ANY?) :: (STRING?)","apoc.convert.toJson([1,2,3]) or toJson({a:42,b:\"foo\",c:[1,2,3]})",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.toList","apoc.convert.toList(list :: ANY?) :: (LIST? OF ANY?)","apoc.convert.toList(value) | tries it's best to convert the value to a list",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.toMap","apoc.convert.toMap(map :: ANY?) :: (MAP?)","apoc.convert.toMap(value) | tries it's best to convert the value to a map",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.toNode","apoc.convert.toNode(node :: ANY?) :: (NODE?)","apoc.convert.toNode(value) | tries it's best to convert the value to a node",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.toRelationship","apoc.convert.toRelationship(relationship :: ANY?) :: (RELATIONSHIP?)","apoc.convert.toRelationship(value) | tries it's best to convert the value to a relationship",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.toSet","apoc.convert.toSet(list :: ANY?) :: (LIST? OF ANY?)","apoc.convert.toSet(value) | tries it's best to convert the value to a set",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.convert.toString","apoc.convert.toString(string :: ANY?) :: (STRING?)","apoc.convert.toString(value) | tries it's best to convert the value to a string",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.create.uuid","apoc.create.uuid() :: (STRING?)","apoc.create.uuid() - creates an UUID",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.data.domain","apoc.data.domain(url_or_email_address :: STRING?) :: (STRING?)","apoc.data.domain('url_or_email_address') YIELD domain - extract the domain name from a url or an email address. If nothing was found, yield null.",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.date.fields","apoc.date.fields(date :: STRING?, pattern = yyyy-MM-dd HH:mm:ss :: STRING?) :: (MAP?)","apoc.date.fields('2012-12-23',('yyyy-MM-dd')) - return columns and a map representation of date parsed with the given format with entries for years,months,weekdays,days,hours,minutes,seconds,zoneid",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.date.format","apoc.date.format(time :: INTEGER?, unit = ms :: STRING?, format = yyyy-MM-dd HH:mm:ss :: STRING?, timezone = :: STRING?) :: (STRING?)","apoc.date.format(12345,('ms|s|m|h|d'),('yyyy-MM-dd HH:mm:ss zzz'),('TZ')) get string representation of time value optionally using the specified unit (default ms) using specified format (default ISO) and specified time zone (default current TZ)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.date.parse","apoc.date.parse(time :: STRING?, unit = ms :: STRING?, format = yyyy-MM-dd HH:mm:ss :: STRING?, timezone = :: STRING?) :: (INTEGER?)","apoc.date.parse('2012-12-23','ms|s|m|h|d','yyyy-MM-dd') parse date string using the specified format into the specified time unit",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.date.systemTimezone","apoc.date.systemTimezone() :: (STRING?)","apoc.date.systemTimezone() returns the system timezone display name",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.date.toYears","apoc.date.toYears(value :: ANY?, format = yyyy-MM-dd HH:mm:ss :: STRING?) :: (FLOAT?)","toYears(timestap) or toYears(date[,format]) converts timestamp into floating point years",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.clean","apoc.map.clean(map :: MAP?, keys :: LIST? OF STRING?, values :: LIST? OF ANY?) :: (MAP?)","apoc.map.clean(map,[skip,keys],[skip,values]) yield map removes the keys and values contained in those lists, good for data cleaning from CSV/JSON",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.flatten","apoc.map.flatten(map :: MAP?) :: (MAP?)","apoc.map.flatten(map) yield map - flattens nested items in map using dot notation",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.fromLists","apoc.map.fromLists(keys :: LIST? OF STRING?, values :: LIST? OF ANY?) :: (MAP?)","apoc.map.fromLists([keys],[values])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.fromNodes","apoc.map.fromNodes(label :: STRING?, property :: STRING?) :: (MAP?)","apoc.map.fromNodes(label, property)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.fromPairs","apoc.map.fromPairs(pairs :: LIST? OF LIST? OF ANY?) :: (MAP?)","apoc.map.fromPairs([[key,value],[key2,value2],...])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.fromValues","apoc.map.fromValues(values :: LIST? OF ANY?) :: (MAP?)","apoc.map.fromValues([key1,value1,key2,value2,...])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.groupBy","apoc.map.groupBy(values :: LIST? OF ANY?, key :: STRING?) :: (MAP?)","apoc.map.groupBy([maps/nodes/relationships],'key') yield value - creates a map of the list keyed by the given property, with single values",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.groupByMulti","apoc.map.groupByMulti(values :: LIST? OF ANY?, key :: STRING?) :: (MAP?)","apoc.map.groupByMulti([maps/nodes/relationships],'key') yield value - creates a map of the list keyed by the given property, with list values",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.merge","apoc.map.merge(first :: MAP?, second :: MAP?) :: (MAP?)","apoc.map.merge(first,second) - merges two maps",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.mergeList","apoc.map.mergeList(maps :: LIST? OF MAP?) :: (MAP?)","apoc.map.mergeList([{maps}]) yield value - merges all maps in the list into one",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.removeKey","apoc.map.removeKey(map :: MAP?, key :: STRING?) :: (MAP?)","apoc.map.removeKey(map,key)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.removeKeys","apoc.map.removeKeys(map :: MAP?, keys :: LIST? OF STRING?) :: (MAP?)","apoc.map.removeKeys(map,keys)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.setEntry","apoc.map.setEntry(map :: MAP?, key :: STRING?, value :: ANY?) :: (MAP?)","apoc.map.setEntry(map,key,value)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.setKey","apoc.map.setKey(map :: MAP?, key :: STRING?, value :: ANY?) :: (MAP?)","apoc.map.setKey(map,key,value)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.setLists","apoc.map.setLists(map :: MAP?, keys :: LIST? OF STRING?, values :: LIST? OF ANY?) :: (MAP?)","apoc.map.setLists(map,[keys],[values])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.setPairs","apoc.map.setPairs(map :: MAP?, pairs :: LIST? OF LIST? OF ANY?) :: (MAP?)","apoc.map.setPairs(map,[[key1,value1],[key2,value2])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.map.setValues","apoc.map.setValues(map :: MAP?, pairs :: LIST? OF ANY?) :: (MAP?)","apoc.map.setValues(map,[key1,value1,key2,value2])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.math.round","apoc.math.round(value :: FLOAT?, precision = 0 :: INTEGER?, mode = HALF_UP :: STRING?) :: (FLOAT?)","apoc.math.round(value,[prec],mode=[CEILING,FLOOR,UP,DOWN,HALF_EVEN,HALF_DOWN,HALF_UP,DOWN,UNNECESSARY])",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.meta.isType","apoc.meta.isType(value :: ANY?, type :: STRING?) :: (BOOLEAN?)","apoc.meta.isType(value,type) - returns a row if type name matches none if not (INTEGER,FLOAT,STRING,BOOLEAN,RELATIONSHIP,NODE,PATH,NULL,UNKNOWN,MAP,LIST)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.meta.type","apoc.meta.type(value :: ANY?) :: (STRING?)","apoc.meta.type(value) - type name of a value (INTEGER,FLOAT,STRING,BOOLEAN,RELATIONSHIP,NODE,PATH,NULL,UNKNOWN,MAP,LIST)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.meta.typeName","apoc.meta.typeName(value :: ANY?) :: (STRING?)","apoc.meta.typeName(value) - type name of a value (INTEGER,FLOAT,STRING,BOOLEAN,RELATIONSHIP,NODE,PATH,NULL,UNKNOWN,MAP,LIST)",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.meta.types","apoc.meta.types(properties :: ANY?) :: (MAP?)","apoc.meta.types(node-relationship-map) - returns a map of keys to types",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.node.relationship.exists","apoc.node.relationship.exists(node :: NODE?, types :: STRING?) :: (BOOLEAN?)","apoc.node.relationship.exists(node, rel-direction-pattern) - yields true effectively when the node has the relationships of the pattern",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.nodes.isDense","apoc.nodes.isDense(node :: NODE?) :: (BOOLEAN?)","apoc.nodes.isDense(node) - returns true if it is a dense node",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.number.format","apoc.number.format(number :: ANY?, pattern = :: STRING?, lang = :: STRING?) :: (STRING?)","apoc.number.format(number) | format a long or double using the default system pattern and language to produce a string",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.number.parseFloat","apoc.number.parseFloat(text :: STRING?, pattern = :: STRING?, lang = :: STRING?) :: (FLOAT?)","apoc.number.parseFloat(text) | parse a text using the default system pattern and language to produce a double",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.number.parseInt","apoc.number.parseInt(text :: STRING?, pattern = :: STRING?, lang = :: STRING?) :: (INTEGER?)","apoc.number.parseInt(text) | parse a text using the default system pattern and language to produce a long",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.scoring.existence","apoc.scoring.existence(score :: INTEGER?, exists :: BOOLEAN?) :: (FLOAT?)","apoc.scoring.existence(5, true) returns the provided score if true, 0 if false",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.scoring.pareto","apoc.scoring.pareto(minimumThreshold :: INTEGER?, eightyPercentValue :: INTEGER?, maximumValue :: INTEGER?, score :: INTEGER?) :: (FLOAT?)","apoc.scoring.pareto(10, 20, 100, 11) applies a Pareto scoring function over the inputs",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.text.clean","apoc.text.clean(text :: STRING?) :: (STRING?)","apoc.text.clean(text) - strip the given string of everything except alpha numeric characters and convert it to lower case.",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.text.compareCleaned","apoc.text.compareCleaned(text1 :: STRING?, text2 :: STRING?) :: (BOOLEAN?)","apoc.text.compareCleaned(text1, text2) - compare the given strings stripped of everything except alpha numeric characters converted to lower case.",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.text.join","apoc.text.join(texts :: LIST? OF STRING?, delimiter :: STRING?) :: (STRING?)","apoc.text.join(['text1','text2',...], delimiter) - join the given strings with the given delimiter.",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.text.regreplace","apoc.text.regreplace(text :: STRING?, regex :: STRING?, replacement :: STRING?) :: (STRING?)","apoc.text.regreplace(text, regex, replacement) - replace each substring of the given string that matches the given regular expression with the given replacement.",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.text.replace","apoc.text.replace(text :: STRING?, regex :: STRING?, replacement :: STRING?) :: (STRING?)","apoc.text.replace(text, regex, replacement) - replace each substring of the given string that matches the given regular expression with the given replacement.",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.text.urldecode","apoc.text.urldecode(text :: STRING?) :: (STRING?)","apoc.text.urldecode(text) - return the urldecoded text",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.text.urlencode","apoc.text.urlencode(text :: STRING?) :: (STRING?)","apoc.text.urlencode(text) - return the urlencoded text",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.trigger.nodesByLabel","apoc.trigger.nodesByLabel(labelEntries :: ANY?, label :: STRING?) :: (LIST? OF ANY?)","",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.trigger.propertiesByKey","apoc.trigger.propertiesByKey(propertyEntries :: ANY?, key :: STRING?) :: (LIST? OF ANY?)","",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.util.md5","apoc.util.md5(values :: LIST? OF ANY?) :: (STRING?)","apoc.util.md5([values]) | computes the md5 of the concatenation of all string values of the list",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}},{"row":["apoc.util.sha1","apoc.util.sha1(values :: LIST? OF ANY?) :: (STRING?)","apoc.util.sha1([values]) | computes the sha1 of the concatenation of all string values of the list",["admin","reader","publisher","architect"]],"meta":[null,null,null,null],"graph":{"nodes":[],"relationships":[]}}],"stats":{"nodes_created":0,"nodes_deleted":0,"relationships_created":0,"relationships_deleted":0,"properties_set":0,"labels_added":0,"labels_removed":0,"indexes_added":0,"indexes_removed":0,"constraints_added":0,"constraints_removed":0,"contains_updates":false}} diff --git a/src/components/comander/cypher/_data/procedures.json b/src/components/comander/cypher/_data/procedures.json new file mode 100644 index 0000000..66f2729 --- /dev/null +++ b/src/components/comander/cypher/_data/procedures.json @@ -0,0 +1,2360 @@ +{ + + "columns": ["name", "signature", "description", "roles"], + "data": [ + { + "row": [ + "apoc.algo.aStar", + "apoc.algo.aStar(startNode :: NODE?, endNode :: NODE?, relationshipTypesAndDirections :: STRING?, weightPropertyName :: STRING?, latPropertyName :: STRING?, lonPropertyName :: STRING?) :: (path :: PATH?, weight :: FLOAT?)", + "apoc.algo.aStar(startNode, endNode, 'KNOWS|', 'distance','lat','lon') YIELD path, weight - run A* with relationship property name as cost function", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.aStarConfig", + "apoc.algo.aStarConfig(startNode :: NODE?, endNode :: NODE?, relationshipTypesAndDirections :: STRING?, config :: MAP?) :: (path :: PATH?, weight :: FLOAT?)", + "apoc.algo.aStar(startNode, endNode, 'KNOWS|', {weight:'dist',default:10,x:'lon',y:'lat'}) YIELD path, weight - run A* with relationship property name as cost function", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.allSimplePaths", + "apoc.algo.allSimplePaths(startNode :: NODE?, endNode :: NODE?, relationshipTypesAndDirections :: STRING?, maxNodes :: INTEGER?) :: (path :: PATH?)", + "apoc.algo.allSimplePaths(startNode, endNode, 'KNOWS|', 5) YIELD path, weight - run allSimplePaths with relationships given and maxNodes", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.betweenness", + "apoc.algo.betweenness(types :: LIST? OF STRING?, nodes :: LIST? OF NODE?, direction :: STRING?) :: (node :: NODE?, score :: FLOAT?)", + "CALL apoc.algo.betweenness(['TYPE',...],nodes,BOTH) YIELD node, score - calculate betweenness centrality for given nodes", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.betweennessCypher", + "apoc.algo.betweennessCypher(config :: MAP?) :: (nodes :: INTEGER?, relationships :: INTEGER?, readNodeMillis :: INTEGER?, readRelationshipMillis :: INTEGER?, computeMillis :: INTEGER?, writeMillis :: INTEGER?, write :: BOOLEAN?, property :: STRING?)", + "CALL apoc.algo.betweennessCypher(node_cypher,rel_cypher,write) - calculates betweeness centrality based on cypher input", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.cliques", + "apoc.algo.cliques(minSize :: NUMBER?) :: (clique :: LIST? OF NODE?)", + "apoc.algo.cliques(minSize) YIELD cliques - search the graph and return all maximal cliques at least at large as the minimum size argument.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.cliquesWithNode", + "apoc.algo.cliquesWithNode(startNode :: NODE?, minSize :: NUMBER?) :: (clique :: LIST? OF NODE?)", + "apoc.algo.cliquesWithNode(startNode, minSize) YIELD cliques - search the graph and return all maximal cliques that are at least as large than the minimum size argument and contain this node ", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.closeness", + "apoc.algo.closeness(types :: LIST? OF STRING?, nodes :: LIST? OF NODE?, direction :: STRING?) :: (node :: NODE?, score :: FLOAT?)", + "CALL apoc.algo.closeness(['TYPE',...],nodes, INCOMING) YIELD node, score - calculate closeness centrality for given nodes", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.community", + "apoc.algo.community(times :: INTEGER?, labels :: LIST? OF STRING?, partitionKey :: STRING?, type :: STRING?, direction :: STRING?, weightKey :: STRING?, batchSize :: INTEGER?) :: VOID", + "CALL apoc.algo.community(times,labels,partitionKey,type,direction,weightKey,batchSize) - simple label propagation kernel", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.cover", + "apoc.algo.cover(nodes :: ANY?) :: (rel :: RELATIONSHIP?)", + "apoc.algo.cover(nodes) yield rel - returns all relationships between this set of nodes", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.dijkstra", + "apoc.algo.dijkstra(startNode :: NODE?, endNode :: NODE?, relationshipTypesAndDirections :: STRING?, weightPropertyName :: STRING?) :: (path :: PATH?, weight :: FLOAT?)", + "apoc.algo.dijkstra(startNode, endNode, 'KNOWS|', 'distance') YIELD path, weight - run dijkstra with relationship property name as cost function", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.dijkstraWithDefaultWeight", + "apoc.algo.dijkstraWithDefaultWeight(startNode :: NODE?, endNode :: NODE?, relationshipTypesAndDirections :: STRING?, weightPropertyName :: STRING?, defaultWeight :: FLOAT?) :: (path :: PATH?, weight :: FLOAT?)", + "apoc.algo.dijkstraWithDefaultWeight(startNode, endNode, 'KNOWS|', 'distance', 10) YIELD path, weight - run dijkstra with relationship property name as cost function and a default weight if the property does not exist", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.pageRank", + "apoc.algo.pageRank(nodes :: LIST? OF NODE?) :: (node :: NODE?, score :: FLOAT?)", + "CALL apoc.algo.pageRank(nodes) YIELD node, score - calculates page rank for given nodes", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.pageRankStats", + "apoc.algo.pageRankStats(config :: MAP?) :: (nodes :: INTEGER?, relationships :: INTEGER?, iterations :: INTEGER?, readNodeMillis :: INTEGER?, readRelationshipMillis :: INTEGER?, computeMillis :: INTEGER?, writeMillis :: INTEGER?, write :: BOOLEAN?, property :: STRING?)", + "CALL apoc.algo.pageRankStats({iterations:_,types:_,write:true,...}) YIELD nodeCount - calculates page rank on graph for given nodes and potentially writes back", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.pageRankWithConfig", + "apoc.algo.pageRankWithConfig(nodes :: LIST? OF NODE?, config :: MAP?) :: (node :: NODE?, score :: FLOAT?)", + "CALL apoc.algo.pageRankWithConfig(nodes,{iterations:_,types:_}) YIELD node, score, info - calculates page rank for given nodes", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.pageRankWithCypher", + "apoc.algo.pageRankWithCypher(config :: MAP?) :: (nodes :: INTEGER?, relationships :: INTEGER?, iterations :: INTEGER?, readNodeMillis :: INTEGER?, readRelationshipMillis :: INTEGER?, computeMillis :: INTEGER?, writeMillis :: INTEGER?, write :: BOOLEAN?, property :: STRING?)", + "CALL apoc.algo.pageRankWithCypher({iterations,node_cypher,rel_cypher,write,property,numCpu}) - calculates page rank based on cypher input", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.algo.wcc", + "apoc.algo.wcc() :: (nodeIds :: LIST? OF INTEGER?, stats :: MAP?)", + "CALL apoc.algo.wcc() YIELD number of weakly connected components", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.bitwise.op", + "apoc.bitwise.op(a :: INTEGER?, operator :: STRING?, b :: INTEGER?) :: (value :: INTEGER?)", + "apoc.bitwise.op(60,'|',13) bitwise operations a & b, a | b, a ^ b, ~a, a >> b, a >>> b, a << b. returns the result of the bitwise operation", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cluster.graph", + "apoc.cluster.graph() :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?)", + "", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.coll.partition", + "apoc.coll.partition(values :: LIST? OF ANY?, batchSize :: INTEGER?) :: (value :: LIST? OF ANY?)", + "apoc.coll.partition(list,batchSize)", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.coll.split", + "apoc.coll.split(values :: LIST? OF ANY?, value :: ANY?) :: (value :: LIST? OF ANY?)", + "apoc.coll.split(list,value) | splits collection on given values rows of lists, value itself will not be part of resulting lists", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.coll.zipToRows", + "apoc.coll.zipToRows(list1 :: LIST? OF ANY?, list2 :: LIST? OF ANY?) :: (value :: LIST? OF ANY?)", + "apoc.coll.zipToRows(list1,list2) - creates pairs like zip but emits one row per pair", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.config.list", + "apoc.config.list() :: (key :: STRING?, value :: ANY?)", + "", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.config.map", + "apoc.config.map() :: (value :: MAP?)", + "", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.convert.setJsonProperty", + "apoc.convert.setJsonProperty(node :: NODE?, key :: STRING?, value :: ANY?) :: VOID", + "apoc.json.setJsonProperty(node,key,complexValue) - sets value serialized to JSON as property with the given name on the node", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.convert.toTree", + "apoc.convert.toTree(paths :: LIST? OF PATH?) :: (value :: MAP?)", + "apoc.convert.toTree([paths]) creates a stream of nested documents representing the at least one root of these paths", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.append", + "apoc.couchbase.append(nodes :: LIST? OF STRING?, bucket :: STRING?, documentId :: STRING?, json :: STRING?) :: (id :: STRING?, expiry :: INTEGER?, cas :: INTEGER?, mutationToken :: MAP?, content :: MAP?)", + "apoc.couchbase.append(nodes, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - append a couchbase json document to an existing one.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.exists", + "apoc.couchbase.exists(nodes :: LIST? OF STRING?, bucket :: STRING?, documentId :: STRING?) :: (value :: BOOLEAN?)", + "apoc.couchbase.exists(nodes, bucket, documentId) yield value - check whether a couchbase json document with the given ID does exist.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.get", + "apoc.couchbase.get(nodes :: LIST? OF STRING?, bucket :: STRING?, documentId :: STRING?) :: (id :: STRING?, expiry :: INTEGER?, cas :: INTEGER?, mutationToken :: MAP?, content :: MAP?)", + "apoc.couchbase.get(nodes, bucket, documentId) yield id, expiry, cas, mutationToken, content - retrieves a couchbase json document by its unique ID.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.insert", + "apoc.couchbase.insert(nodes :: LIST? OF STRING?, bucket :: STRING?, documentId :: STRING?, json :: STRING?) :: (id :: STRING?, expiry :: INTEGER?, cas :: INTEGER?, mutationToken :: MAP?, content :: MAP?)", + "apoc.couchbase.insert(nodes, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - insert a couchbase json document with its unique ID.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.namedParamsQuery", + "apoc.couchbase.namedParamsQuery(nodes :: LIST? OF STRING?, bucket :: STRING?, statement :: STRING?, paramNames :: LIST? OF STRING?, paramValues :: LIST? OF ANY?) :: (queryResult :: LIST? OF MAP?)", + "apoc.couchbase.namedParamsQuery(nodes, bucket, statement, paramNames, paramValues) yield queryResult - executes a N1QL statement with named parameters.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.posParamsQuery", + "apoc.couchbase.posParamsQuery(nodes :: LIST? OF STRING?, bucket :: STRING?, statement :: STRING?, params :: LIST? OF ANY?) :: (queryResult :: LIST? OF MAP?)", + "apoc.couchbase.posParamsQuery(nodes, bucket, statement, params) yield queryResult - executes a N1QL statement with positional parameters.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.prepend", + "apoc.couchbase.prepend(nodes :: LIST? OF STRING?, bucket :: STRING?, documentId :: STRING?, json :: STRING?) :: (id :: STRING?, expiry :: INTEGER?, cas :: INTEGER?, mutationToken :: MAP?, content :: MAP?)", + "apoc.couchbase.prepend(nodes, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - prepend a couchbase json document to an existing one.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.query", + "apoc.couchbase.query(nodes :: LIST? OF STRING?, bucket :: STRING?, statement :: STRING?) :: (queryResult :: LIST? OF MAP?)", + "apoc.couchbase.query(nodes, bucket, statement) yield queryResult - executes a plain un-parameterized N1QL statement.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.remove", + "apoc.couchbase.remove(nodes :: LIST? OF STRING?, bucket :: STRING?, documentId :: STRING?) :: (id :: STRING?, expiry :: INTEGER?, cas :: INTEGER?, mutationToken :: MAP?, content :: MAP?)", + "apoc.couchbase.remove(nodes, bucket, documentId) yield id, expiry, cas, mutationToken, content - remove the couchbase json document identified by its unique ID.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.replace", + "apoc.couchbase.replace(nodes :: LIST? OF STRING?, bucket :: STRING?, documentId :: STRING?, json :: STRING?) :: (id :: STRING?, expiry :: INTEGER?, cas :: INTEGER?, mutationToken :: MAP?, content :: MAP?)", + "apoc.couchbase.replace(nodes, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - replace the content of the couchbase json document identified by its unique ID.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.couchbase.upsert", + "apoc.couchbase.upsert(nodes :: LIST? OF STRING?, bucket :: STRING?, documentId :: STRING?, json :: STRING?) :: (id :: STRING?, expiry :: INTEGER?, cas :: INTEGER?, mutationToken :: MAP?, content :: MAP?)", + "apoc.couchbase.upsert(nodes, bucket, documentId, jsonDocument) yield id, expiry, cas, mutationToken, content - insert or overwrite a couchbase json document with its unique ID.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.addLabels", + "apoc.create.addLabels(nodes :: ANY?, label :: LIST? OF STRING?) :: (node :: NODE?)", + "apoc.create.addLabels( [node,id,ids,nodes], ['Label',...]) - adds the given labels to the node or nodes", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.node", + "apoc.create.node(label :: LIST? OF STRING?, props :: MAP?) :: (node :: NODE?)", + "apoc.create.node(['Label'], {key:value,...}) - create node with dynamic labels", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.nodes", + "apoc.create.nodes(label :: LIST? OF STRING?, props :: LIST? OF MAP?) :: (node :: NODE?)", + "apoc.create.nodes(['Label'], [{key:value,...}]) create multiple nodes with dynamic labels", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.relationship", + "apoc.create.relationship(from :: NODE?, relType :: STRING?, props :: MAP?, to :: NODE?) :: (rel :: RELATIONSHIP?)", + "apoc.create.relationship(person1,'KNOWS',{key:value,...}, person2) create relationship with dynamic rel-type", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.removeLabels", + "apoc.create.removeLabels(nodes :: ANY?, label :: LIST? OF STRING?) :: (node :: NODE?)", + "apoc.create.removeLabels( [node,id,ids,nodes], ['Label',...]) - removes the given labels from the node or nodes", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.setLabels", + "apoc.create.setLabels(nodes :: ANY?, label :: LIST? OF STRING?) :: (node :: NODE?)", + "apoc.create.setLabels( [node,id,ids,nodes], ['Label',...]) - sets the given labels, non matching labels are removed on the node or nodes", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.setProperties", + "apoc.create.setProperties(nodes :: ANY?, keys :: LIST? OF STRING?, values :: LIST? OF ANY?) :: (node :: NODE?)", + "apoc.create.setProperties( [node,id,ids,nodes], [keys], [values]) - sets the given property on the nodes(s)", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.setProperty", + "apoc.create.setProperty(nodes :: ANY?, key :: STRING?, value :: ANY?) :: (node :: NODE?)", + "apoc.create.setProperty( [node,id,ids,nodes], key, value) - sets the given property on the node(s)", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.setRelProperties", + "apoc.create.setRelProperties(rels :: ANY?, keys :: LIST? OF STRING?, values :: LIST? OF ANY?) :: (rel :: RELATIONSHIP?)", + "apoc.create.setRelProperties( [rel,id,ids,rels], [keys], [values]) - sets the given property on the relationship(s)", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.setRelProperty", + "apoc.create.setRelProperty(relationships :: ANY?, key :: STRING?, value :: ANY?) :: (rel :: RELATIONSHIP?)", + "apoc.create.setRelProperty( [rel,id,ids,rels], key, value) - sets the given property on the relationship(s)", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.uuids", + "apoc.create.uuids(count :: INTEGER?) :: (row :: INTEGER?, uuid :: STRING?)", + "apoc.create.uuids(count) yield uuid - creates 'count' UUIDs ", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.vNode", + "apoc.create.vNode(label :: LIST? OF STRING?, props :: MAP?) :: (node :: NODE?)", + "apoc.create.vNode(['Label'], {key:value,...}) returns a virtual node", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.vNodes", + "apoc.create.vNodes(label :: LIST? OF STRING?, props :: LIST? OF MAP?) :: (node :: NODE?)", + "apoc.create.vNodes(['Label'], [{key:value,...}]) returns virtual nodes", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.vPattern", + "apoc.create.vPattern(from :: MAP?, relType :: STRING?, props :: MAP?, to :: MAP?) :: (from :: NODE?, rel :: RELATIONSHIP?, to :: NODE?)", + "apoc.create.vPattern({_labels:['LabelA'],key:value},'KNOWS',{key:value,...}, {_labels:['LabelB'],key:value}) returns a virtual pattern", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.vPatternFull", + "apoc.create.vPatternFull(labelsN :: LIST? OF STRING?, n :: MAP?, relType :: STRING?, props :: MAP?, labelsM :: LIST? OF STRING?, m :: MAP?) :: (from :: NODE?, rel :: RELATIONSHIP?, to :: NODE?)", + "apoc.create.vPatternFull(['LabelA'],{key:value},'KNOWS',{key:value,...},['LabelB'],{key:value}) returns a virtual pattern", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.create.vRelationship", + "apoc.create.vRelationship(from :: NODE?, relType :: STRING?, props :: MAP?, to :: NODE?) :: (rel :: RELATIONSHIP?)", + "apoc.create.vRelationship(nodeFrom,'KNOWS',{key:value,...}, nodeTo) returns a virtual relationship", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cypher.doit", + "apoc.cypher.doit(cypher :: STRING?, params :: MAP?) :: (value :: MAP?)", + "apoc.cypher.doIt(fragment, params) yield value - executes writing fragment with the given parameters", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cypher.mapParallel", + "apoc.cypher.mapParallel(fragment :: STRING?, params :: MAP?, list :: LIST? OF ANY?) :: (value :: MAP?)", + "apoc.cypher.mapParallel(fragment, params, list-to-parallelize) yield value - executes fragment in parallel batches with the list segments being assigned to _", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cypher.mapParallel2", + "apoc.cypher.mapParallel2(fragment :: STRING?, params :: MAP?, list :: LIST? OF ANY?, partitions :: INTEGER?) :: (value :: MAP?)", + "apoc.cypher.mapParallel2(fragment, params, list-to-parallelize) yield value - executes fragment in parallel batches with the list segments being assigned to _", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cypher.parallel", + "apoc.cypher.parallel(fragment :: STRING?, params :: MAP?, parallelizeOn :: STRING?) :: (value :: MAP?)", + "", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cypher.parallel2", + "apoc.cypher.parallel2(fragment :: STRING?, params :: MAP?, parallelizeOn :: STRING?) :: (value :: MAP?)", + "", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cypher.run", + "apoc.cypher.run(cypher :: STRING?, params :: MAP?) :: (value :: MAP?)", + "apoc.cypher.run(fragment, params) yield value - executes reading fragment with the given parameters", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cypher.runFile", + "apoc.cypher.runFile(file :: STRING?) :: (row :: INTEGER?, result :: MAP?)", + "apoc.cypher.runFile(file or url) - runs each statement in the file, all semicolon separated - currently no schema operations", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cypher.runMany", + "apoc.cypher.runMany(cypher :: STRING?, params :: MAP?) :: (row :: INTEGER?, result :: MAP?)", + "apoc.cypher.runMany('cypher;\\nstatements;',{params}) - runs each semicolon separated statement and returns summary - currently no schema operations", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.cypher.runTimeboxed", + "apoc.cypher.runTimeboxed(cypher :: STRING?, params :: MAP?, timeout :: INTEGER?) :: (value :: MAP?)", + "apoc.cypher.runTimeboxed('cypherStatement',{params}, timeout) - abort statement after timeout ms if not finished", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.date.expire", + "apoc.date.expire(node :: NODE?, time :: INTEGER?, timeUnit :: STRING?) :: VOID", + "CALL apoc.date.expire(node,time,'time-unit') - expire node in given time by setting :TTL label and `ttl` property", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.date.expireIn", + "apoc.date.expireIn(node :: NODE?, timeDelta :: INTEGER?, timeUnit :: STRING?) :: VOID", + "CALL apoc.date.expire.in(node,time,'time-unit') - expire node in given time-delta by setting :TTL label and `ttl` property", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.es.get", + "apoc.es.get(host :: STRING?, index :: STRING?, type :: STRING?, id :: STRING?, query :: ANY?, payload :: ANY?) :: (value :: MAP?)", + "apoc.es.get(host-or-port,index-or-null,type-or-null,id-or-null,query-or-null,payload-or-null) yield value - perform a GET operation on elastic search", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.es.getRaw", + "apoc.es.getRaw(host :: STRING?, path :: STRING?, payload :: ANY?) :: (value :: MAP?)", + "apoc.es.getRaw(host-or-port,path,payload-or-null) yield value - perform a raw GET operation on elastic search", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.es.post", + "apoc.es.post(host :: STRING?, index :: STRING?, type :: STRING?, id :: STRING?, query :: ANY?, payload :: ANY?) :: (value :: MAP?)", + "apoc.es.post(host-or-port,index-or-null,type-or-null,query-or-null,payload-or-null) yield value - perform a POST operation on elastic search", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.es.postRaw", + "apoc.es.postRaw(host :: STRING?, path :: STRING?, payload :: ANY?) :: (value :: MAP?)", + "apoc.es.postRaw(host-or-port,path,payload-or-null) yield value - perform a raw POST operation on elastic search", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.es.put", + "apoc.es.put(host :: STRING?, index :: STRING?, type :: STRING?, id :: STRING?, query :: ANY?, payload :: ANY?) :: (value :: MAP?)", + "apoc.es.put(host-or-port,index-or-null,type-or-null,query-or-null,payload-or-null) yield value - perform a PUT operation on elastic search", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.es.query", + "apoc.es.query(host :: STRING?, index :: STRING?, type :: STRING?, query :: ANY?, payload :: ANY?) :: (value :: MAP?)", + "apoc.es.query(host-or-port,index-or-null,type-or-null,query-or-null,payload-or-null) yield value - perform a SEARCH operation on elastic search", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.es.stats", + "apoc.es.stats(host :: STRING?) :: (value :: MAP?)", + "apoc.es.stats(host-url-Key) - elastic search statistics", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.example.movies", + "apoc.example.movies() :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.example.movies() | Creates the sample movies graph", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.csv.all", + "apoc.export.csv.all(file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.csv.data", + "apoc.export.csv.data(nodes :: LIST? OF NODE?, rels :: LIST? OF RELATIONSHIP?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.csv.graph", + "apoc.export.csv.graph(graph :: MAP?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.csv.query", + "apoc.export.csv.query(query :: STRING?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.cypher.all", + "apoc.export.cypher.all(file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.cypher.all(file,config) - exports whole database incl. indexes as cypher statements to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.cypher.data", + "apoc.export.cypher.data(nodes :: LIST? OF NODE?, rels :: LIST? OF RELATIONSHIP?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.cypher.data(nodes,rels,file,config) - exports given nodes and relationships incl. indexes as cypher statements to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.cypher.graph", + "apoc.export.cypher.graph(graph :: MAP?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.cypher.graph(graph,file,config) - exports given graph object incl. indexes as cypher statements to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.cypher.query", + "apoc.export.cypher.query(query :: STRING?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.cypher.query(query,file,config) - exports nodes and relationships from the cypher statement incl. indexes as cypher statements to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.cypherAll", + "apoc.export.cypherAll(file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.cypherAll(file,config) - exports whole database incl. indexes as cypher statements to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.cypherData", + "apoc.export.cypherData(nodes :: LIST? OF NODE?, rels :: LIST? OF RELATIONSHIP?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.cypherData(nodes,rels,file,config) - exports given nodes and relationships incl. indexes as cypher statements to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.cypherGraph", + "apoc.export.cypherGraph(graph :: MAP?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.cypherGraph(graph,file,config) - exports given graph object incl. indexes as cypher statements to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.cypherQuery", + "apoc.export.cypherQuery(query :: STRING?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.cypherQuery(query,file,config) - exports nodes and relationships from the cypher statement incl. indexes as cypher statements to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.graphml.all", + "apoc.export.graphml.all(file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.graphml.all(file,config) - exports whole database as graphml to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.graphml.data", + "apoc.export.graphml.data(nodes :: LIST? OF NODE?, rels :: LIST? OF RELATIONSHIP?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.graphml.data(nodes,rels,file,config) - exports given nodes and relationships as graphml to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.graphml.graph", + "apoc.export.graphml.graph(graph :: MAP?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.graphml.graph(graph,file,config) - exports given graph object as graphml to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.export.graphml.query", + "apoc.export.graphml.query(query :: STRING?, file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.export.graphml.query(query,file,config) - exports nodes and relationships from the cypher statement as graphml to the provided file", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.generate.ba", + "apoc.generate.ba(noNodes :: INTEGER?, edgesPerNode :: INTEGER?, label :: STRING?, type :: STRING?) :: VOID", + "apoc.generate.ba(noNodes, edgesPerNode, label, type) - generates a random graph according to the Barabasi-Albert model", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.generate.complete", + "apoc.generate.complete(noNodes :: INTEGER?, label :: STRING?, type :: STRING?) :: VOID", + "apoc.generate.complete(noNodes, label, type) - generates a random complete graph", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.generate.er", + "apoc.generate.er(noNodes :: INTEGER?, noEdges :: INTEGER?, label :: STRING?, type :: STRING?) :: VOID", + "apoc.generate.er(noNodes, noEdges, label, type) - generates a random graph according to the Erdos-Renyi model", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.generate.simple", + "apoc.generate.simple(degrees :: LIST? OF INTEGER?, label :: STRING?, type :: STRING?) :: VOID", + "apoc.generate.simple(degrees, label, type) - generates a simple random graph according to the given degree distribution", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.generate.ws", + "apoc.generate.ws(noNodes :: INTEGER?, degree :: INTEGER?, beta :: FLOAT?, label :: STRING?, type :: STRING?) :: VOID", + "apoc.generate.ws(noNodes, degree, beta, label, type) - generates a random graph according to the Watts-Strogatz model", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.gephi.add", + "apoc.gephi.add(urlOrKey :: STRING?, workspace :: STRING?, data :: ANY?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.gephi.add(url-or-key, workspace, data) | streams passed in data to Gephi", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.get.nodes", + "apoc.get.nodes(nodes :: ANY?) :: (node :: NODE?)", + "apoc.get.nodes(node|id|[ids]) - quickly returns all nodes with these id's", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.get.rels", + "apoc.get.rels(relationships :: ANY?) :: (rel :: RELATIONSHIP?)", + "apoc.get.rels(rel|id|[ids]) - quickly returns all relationships with these id's", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.graph.from", + "apoc.graph.from(data :: ANY?, name :: STRING?, properties :: MAP?) :: (graph :: MAP?)", + "apoc.graph.from(data,'name',{properties}) | creates a virtual graph object for later processing it tries its best to extract the graph information from the data you pass in", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.graph.fromCypher", + "apoc.graph.fromCypher(statement :: STRING?, params :: MAP?, name :: STRING?, properties :: MAP?) :: (graph :: MAP?)", + "apoc.graph.fromCypher('statement',{params},'name',{properties}) - creates a virtual graph object for later processing", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.graph.fromDB", + "apoc.graph.fromDB(name :: STRING?, properties :: MAP?) :: (graph :: MAP?)", + "apoc.graph.fromDB('name',{properties}) - creates a virtual graph object for later processing", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.graph.fromData", + "apoc.graph.fromData(nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?, name :: STRING?, properties :: MAP?) :: (graph :: MAP?)", + "apoc.graph.fromData([nodes],[relationships],'name',{properties}) | creates a virtual graph object for later processing", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.graph.fromPath", + "apoc.graph.fromPath(path :: PATH?, name :: STRING?, properties :: MAP?) :: (graph :: MAP?)", + "apoc.graph.fromPaths(path,'name',{properties}) - creates a virtual graph object for later processing", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.graph.fromPaths", + "apoc.graph.fromPaths(paths :: LIST? OF PATH?, name :: STRING?, properties :: MAP?) :: (graph :: MAP?)", + "apoc.graph.fromPaths([paths],'name',{properties}) - creates a virtual graph object for later processing", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.help", + "apoc.help(proc :: STRING?) :: (type :: STRING?, name :: STRING?, text :: STRING?, signature :: STRING?, roles :: LIST? OF STRING?, writes :: BOOLEAN?)", + "Provides descriptions of available procedures. To narrow the results, supply a search string. To also search in the description text, append + to the end of the search string.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.import.graphml", + "apoc.import.graphml(file :: STRING?, config :: MAP?) :: (file :: STRING?, source :: STRING?, format :: STRING?, nodes :: INTEGER?, relationships :: INTEGER?, properties :: INTEGER?, time :: INTEGER?, rows :: INTEGER?)", + "apoc.import.graphml(file,config) - imports graphml file", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.addAllNodes", + "apoc.index.addAllNodes(index :: STRING?, structure :: MAP?) :: (label :: STRING?, property :: STRING?, nodeCount :: INTEGER?)", + "apoc.index.addAllNodes('name',{label1:['prop1',...],...}) YIELD type, name, config - create a free text search index", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.addAllNodesExtended", + "apoc.index.addAllNodesExtended(index :: STRING?, structure :: MAP?, options :: MAP?) :: (label :: STRING?, property :: STRING?, nodeCount :: INTEGER?)", + "apoc.index.addAllNodes('name',{label1:['prop1',...],...}, {options}) YIELD type, name, config - create a free text search index with special options", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.addNode", + "apoc.index.addNode(node :: NODE?, properties :: LIST? OF STRING?) :: VOID", + "apoc.index.addNode(node,['prop1',...]) add node to an index for each label it has", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.addNodeByLabel", + "apoc.index.addNodeByLabel(label :: STRING?, node :: NODE?, properties :: LIST? OF STRING?) :: VOID", + "apoc.index.addNodeByLabel(node,'Label',['prop1',...]) add node to an index for the given label", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.addRelationship", + "apoc.index.addRelationship(relationship :: RELATIONSHIP?, properties :: LIST? OF STRING?) :: VOID", + "apoc.index.addRelationship(rel,['prop1',...]) add relationship to an index for its type", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.between", + "apoc.index.between(from :: NODE?, type :: STRING?, to :: NODE?, query :: STRING?) :: (rel :: RELATIONSHIP?, weight :: FLOAT?, start :: NODE?, end :: NODE?)", + "apoc.index.between(node1,'TYPE',node2,'prop:value*') YIELD rel - lucene query on relationship index with the given type name bound by either or both sides (each node parameter can be null)", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.forNodes", + "apoc.index.forNodes(name :: STRING?, config :: MAP?) :: (type :: STRING?, name :: STRING?, config :: MAP?)", + "apoc.index.forNodes('name',{config}) YIELD type,name,config - gets or creates node index", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.forRelationships", + "apoc.index.forRelationships(name :: STRING?, config :: MAP?) :: (type :: STRING?, name :: STRING?, config :: MAP?)", + "apoc.index.forRelationships('name',{config}) YIELD type,name,config - gets or creates relationship index", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.in", + "apoc.index.in(to :: NODE?, type :: STRING?, query :: STRING?) :: (node :: NODE?, weight :: FLOAT?)", + "apoc.index.in(node,'TYPE','prop:value*') YIELD node lucene query on relationship index with the given type name for *incoming* relationship of the given node, *returns start-nodes*", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.list", + "apoc.index.list() :: (type :: STRING?, name :: STRING?, config :: MAP?)", + "apoc.index.list() - YIELD type,name,config - lists all manual indexes", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.nodes", + "apoc.index.nodes(label :: STRING?, query :: STRING?) :: (node :: NODE?, weight :: FLOAT?)", + "apoc.index.nodes('Label','prop:value*') YIELD node - lucene query on node index with the given label name", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.orderedByText", + "apoc.index.orderedByText(label :: STRING?, key :: STRING?, operator :: STRING?, value :: STRING?, relevance :: BOOLEAN?, limit :: INTEGER?) :: (node :: NODE?)", + "apoc.index.orderedByText(label,key,operator,value,sort-relevance,limit) yield node - schema string search which keeps index order and adds limit, operator is 'STARTS WITH' or 'CONTAINS'", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.orderedRange", + "apoc.index.orderedRange(label :: STRING?, key :: STRING?, min :: ANY?, max :: ANY?, relevance :: BOOLEAN?, limit :: INTEGER?) :: (node :: NODE?)", + "apoc.index.orderedRange(label,key,min,max,sort-relevance,limit) yield node - schema range scan which keeps index order and adds limit, values can be null, boundaries are inclusive", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.out", + "apoc.index.out(from :: NODE?, type :: STRING?, query :: STRING?) :: (node :: NODE?, weight :: FLOAT?)", + "apoc.index.out(node,'TYPE','prop:value*') YIELD node - lucene query on relationship index with the given type name for *outgoing* relationship of the given node, *returns end-nodes*", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.related", + "apoc.index.related(nodes :: LIST? OF NODE?, label :: STRING?, key :: STRING?, relationship :: STRING?, limit :: INTEGER?) :: (node :: NODE?)", + "apoc.index.relatedNodes([nodes],label,key,''/'TYPE',limit) yield node - schema range scan which keeps index order and adds limit and checks opposite node of relationship against the given set of nodes", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.relationships", + "apoc.index.relationships(type :: STRING?, query :: STRING?) :: (rel :: RELATIONSHIP?, weight :: FLOAT?, start :: NODE?, end :: NODE?)", + "apoc.index.relationships('TYPE','prop:value*') YIELD rel - lucene query on relationship index with the given type name", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.remove", + "apoc.index.remove(name :: STRING?) :: (type :: STRING?, name :: STRING?, config :: MAP?)", + "apoc.index.remove('name') YIELD type,name,config - removes an manual index", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.index.search", + "apoc.index.search(index :: STRING?, query :: STRING?) :: (node :: NODE?, weight :: FLOAT?)", + "apoc.index.search('name', 'query') YIELD node, weight - search for nodes in the free text index matching the given query", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.load.csv", + "apoc.load.csv(url :: STRING?, config :: MAP?) :: (lineNo :: INTEGER?, list :: LIST? OF ANY?, map :: MAP?)", + "apoc.load.csv('url',{config}) YIELD lineNo, list, map - load CSV fom URL as stream of values,\n config contains any of: {skip:1,limit:5,header:false,sep:'TAB',ignore:['tmp'],arraySep:';',mapping:{years:{type:'int',arraySep:'-',array:false,name:'age',ignore:false}}", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.load.driver", + "apoc.load.driver(driverClass :: STRING?) :: VOID", + "apoc.load.driver('org.apache.derby.jdbc.EmbeddedDriver') register JDBC driver of source database", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.load.jdbc", + "apoc.load.jdbc(jdbc :: STRING?, tableOrSql :: STRING?) :: (row :: MAP?)", + "apoc.load.jdbc('key or url','table or statement') YIELD row - load from relational database, from a full table or a sql statement", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.load.jdbcParams", + "apoc.load.jdbcParams(jdbc :: STRING?, sql :: STRING?, params :: LIST? OF ANY?) :: (row :: MAP?)", + "apoc.load.jdbcParams('key or url','statement',[params]) YIELD row - load from relational database, from a sql statement with parameters", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.load.json", + "apoc.load.json(url :: STRING?) :: (value :: MAP?)", + "apoc.load.json('url') YIELD value - import JSON as stream of values if the JSON was an array or a single value if it was a map", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.load.jsonArray", + "apoc.load.jsonArray(url :: STRING?) :: (value :: ANY?)", + "apoc.load.jsonArray('url') YIELD value - load array from JSON URL (e.g. web-api) to import JSON as stream of values", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.load.jsonParams", + "apoc.load.jsonParams(url :: STRING?, headers :: MAP?, payload :: STRING?) :: (value :: MAP?)", + "apoc.load.jsonParams('url',{header:value},payload) YIELD value - load from JSON URL (e.g. web-api) while sending headers / payload to import JSON as stream of values if the JSON was an array or a single value if it was a map", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.load.xml", + "apoc.load.xml(url :: STRING?) :: (value :: MAP?)", + "apoc.load.xml('http://example.com/test.xml') YIELD value as doc CREATE (p:Person) SET p.name = doc.name load from XML URL (e.g. web-api) to import XML as single nested map with attributes and _type, _text and _childrenx fields.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.load.xmlSimple", + "apoc.load.xmlSimple(url :: STRING?) :: (value :: MAP?)", + "apoc.load.xml('http://example.com/test.xml') YIELD value as doc CREATE (p:Person) SET p.name = doc.name load from XML URL (e.g. web-api) to import XML as single nested map with attributes and _type, _text and _childrenx fields.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.lock.all", + "apoc.lock.all(nodes :: LIST? OF NODE?, rels :: LIST? OF RELATIONSHIP?) :: VOID", + "apoc.lock.all([nodes],[relationships]) acquires a write lock on the given nodes and relationships", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.lock.nodes", + "apoc.lock.nodes(nodes :: LIST? OF NODE?) :: VOID", + "apoc.lock.nodes([nodes]) acquires a write lock on the given nodes", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.lock.rels", + "apoc.lock.rels(rels :: LIST? OF RELATIONSHIP?) :: VOID", + "apoc.lock.rels([relationships]) acquires a write lock on the given relationship", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.meta.data", + "apoc.meta.data() :: (label :: STRING?, property :: STRING?, count :: INTEGER?, unique :: BOOLEAN?, index :: BOOLEAN?, existence :: BOOLEAN?, type :: STRING?, array :: BOOLEAN?, sample :: LIST? OF ANY?, leftCount :: INTEGER?, rightCount :: INTEGER?, left :: INTEGER?, right :: INTEGER?, other :: LIST? OF STRING?)", + "apoc.meta.data - examines a subset of the graph to provide a tabular meta information", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.meta.graph", + "apoc.meta.graph() :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?)", + "apoc.meta.graph - examines the full graph to create the meta-graph", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.meta.graphSample", + "apoc.meta.graphSample() :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?)", + "apoc.meta.graphSample() - examines the database statistics to build the meta graph, very fast, might report extra relationships", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.meta.stats", + "apoc.meta.stats() :: (labelCount :: INTEGER?, relTypeCount :: INTEGER?, propertyKeyCount :: INTEGER?, nodeCount :: INTEGER?, relCount :: INTEGER?, labels :: MAP?, relTypes :: MAP?, stats :: MAP?)", + "apoc.meta.stats yield labelCount, relTypeCount, propertyKeyCount, nodeCount, relCount, labels, relTypes, stats | returns the information stored in the transactional database statistics", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.meta.subGraph", + "apoc.meta.subGraph(config :: MAP?) :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?)", + "apoc.meta.subGraph({labels:[labels],rels:[rel-types], excludes:[labels,rel-types]}) - examines a sample sub graph to create the meta-graph", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.mongodb.count", + "apoc.mongodb.count(host :: STRING?, db :: STRING?, collection :: STRING?, query :: MAP?) :: (value :: INTEGER?)", + "apoc.mongodb.count(host-or-port,db-or-null,collection-or-null,query-or-null) yield value - perform a find operation on mongodb collection", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.mongodb.delete", + "apoc.mongodb.delete(host :: STRING?, db :: STRING?, collection :: STRING?, query :: MAP?) :: (value :: INTEGER?)", + "apoc.mongodb.delete(host-or-port,db-or-null,collection-or-null,list-of-maps) - inserts the given documents into the mongodb collection", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.mongodb.find", + "apoc.mongodb.find(host :: STRING?, db :: STRING?, collection :: STRING?, query :: MAP?, project :: MAP?, sort :: MAP?) :: (value :: MAP?)", + "apoc.mongodb.find(host-or-port,db-or-null,collection-or-null,query-or-null,projection-or-null,sort-or-null) yield value - perform a find,project,sort operation on mongodb collection", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.mongodb.first", + "apoc.mongodb.first(host :: STRING?, db :: STRING?, collection :: STRING?, query :: MAP?) :: (value :: MAP?)", + "apoc.mongodb.first(host-or-port,db-or-null,collection-or-null,query-or-null) yield value - perform a first operation on mongodb collection", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.mongodb.get", + "apoc.mongodb.get(host :: STRING?, db :: STRING?, collection :: STRING?, query :: MAP?) :: (value :: MAP?)", + "apoc.mongodb.get(host-or-port,db-or-null,collection-or-null,query-or-null) yield value - perform a find operation on mongodb collection", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.mongodb.insert", + "apoc.mongodb.insert(host :: STRING?, db :: STRING?, collection :: STRING?, documents :: LIST? OF MAP?) :: VOID", + "apoc.mongodb.insert(host-or-port,db-or-null,collection-or-null,list-of-maps) - inserts the given documents into the mongodb collection", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.mongodb.update", + "apoc.mongodb.update(host :: STRING?, db :: STRING?, collection :: STRING?, query :: MAP?, update :: MAP?) :: (value :: INTEGER?)", + "apoc.mongodb.update(host-or-port,db-or-null,collection-or-null,list-of-maps) - inserts the given documents into the mongodb collection", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.monitor.ids", + "apoc.monitor.ids() :: (nodeIds :: INTEGER?, relIds :: INTEGER?, propIds :: INTEGER?, relTypeIds :: INTEGER?)", + "apoc.monitor.ids() returns the object ids in use for this neo4j instance", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.monitor.kernel", + "apoc.monitor.kernel() :: (readOnly :: BOOLEAN?, kernelVersion :: STRING?, storeId :: STRING?, kernelStartTime :: STRING?, databaseName :: STRING?, storeLogVersion :: INTEGER?, storeCreationDate :: STRING?)", + "apoc.monitor.kernel() returns informations about the neo4j kernel", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.monitor.locks", + "apoc.monitor.locks(minWaitTime :: INTEGER?) :: (advertedDeadLocks :: INTEGER?, lockCount :: INTEGER?, contendedLockCount :: INTEGER?, minimumWaitTimeMs :: INTEGER?, contendedLocks :: LIST? OF MAP?, info :: STRING?)", + "apoc.monitor.locks(minWaitTime) yield advertedDeadLocks, lockCount, contendedLockCount, minimumWaitTimeMs, contendedLocks, info", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.monitor.store", + "apoc.monitor.store() :: (logSize :: INTEGER?, stringStoreSize :: INTEGER?, arrayStoreSize :: INTEGER?, relStoreSize :: INTEGER?, propStoreSize :: INTEGER?, totalStoreSize :: INTEGER?, nodeStoreSize :: INTEGER?)", + "apoc.monitor.store() returns informations about the sizes of the different parts of the neo4j graph store", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.monitor.tx", + "apoc.monitor.tx() :: (rolledBackTx :: INTEGER?, peakTx :: INTEGER?, lastTxId :: INTEGER?, currentOpenedTx :: INTEGER?, totalOpenedTx :: INTEGER?, totalTx :: INTEGER?)", + "apoc.monitor.tx() returns informations about the neo4j transaction manager", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.nodes.delete", + "apoc.nodes.delete(nodes :: ANY?, batchSize :: INTEGER?) :: (value :: INTEGER?)", + "apoc.nodes.delete(node|nodes|id|[ids]) - quickly delete all nodes with these id's", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.nodes.get", + "apoc.nodes.get(nodes :: ANY?) :: (node :: NODE?)", + "apoc.nodes.get(node|nodes|id|[ids]) - quickly returns all nodes with these id's", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.nodes.link", + "apoc.nodes.link(nodes :: LIST? OF NODE?, type :: STRING?) :: VOID", + "apoc.nodes.link([nodes],'REL_TYPE') - creates a linked list of nodes from first to last", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.nodes.rels", + "apoc.nodes.rels(relationships :: ANY?) :: (rel :: RELATIONSHIP?)", + "apoc.get.rels(rel|id|[ids]) - quickly returns all relationships with these id's", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.path.expand", + "apoc.path.expand(start :: ANY?, relationshipFilter :: STRING?, labelFilter :: STRING?, minLevel :: INTEGER?, maxLevel :: INTEGER?) :: (path :: PATH?)", + "apoc.path.expand(startNode |Node|list, 'TYPE|TYPE_OUT>||Node|list, {minLevel,maxLevel,uniqueness,relationshipFilter,labelFilter,uniqueness:'RELATIONSHIP_PATH',bfs:true}) yield path expand from start node following the given relationships from min to max-level adhering to the label filters", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.periodic.cancel", + "apoc.periodic.cancel(name :: STRING?) :: (name :: STRING?, delay :: INTEGER?, rate :: INTEGER?, done :: BOOLEAN?, cancelled :: BOOLEAN?)", + "apoc.periodic.cancel(name) - cancel job with the given name", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.periodic.commit", + "apoc.periodic.commit(statement :: STRING?, params :: MAP?) :: (updates :: INTEGER?, executions :: INTEGER?, runtime :: INTEGER?, batches :: INTEGER?, faileBatches :: INTEGER?, batchErrors :: MAP?, failedCommits :: INTEGER?, commitErrors :: MAP?)", + "apoc.periodic.commit(statement,params) - runs the given statement in separate transactions until it returns 0", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.periodic.iterate", + "apoc.periodic.iterate(cypherIterate :: STRING?, cypherAction :: STRING?, config :: MAP?) :: (batches :: INTEGER?, total :: INTEGER?, timeTaken :: INTEGER?, committedOperations :: INTEGER?, failedOperations :: INTEGER?, failedBatches :: INTEGER?, errorMessages :: MAP?, batch :: MAP?, operations :: MAP?)", + "apoc.periodic.iterate('statement returning items', 'statement per item', {batchSize:1000,parallel:true}) YIELD batches, total - run the second statement for each item returned by the first statement. Returns number of batches and total processed rows", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.periodic.list", + "apoc.periodic.list() :: (name :: STRING?, delay :: INTEGER?, rate :: INTEGER?, done :: BOOLEAN?, cancelled :: BOOLEAN?)", + "apoc.periodic.list - list all jobs", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.periodic.repeat", + "apoc.periodic.repeat(name :: STRING?, statement :: STRING?, rate :: INTEGER?) :: (name :: STRING?, delay :: INTEGER?, rate :: INTEGER?, done :: BOOLEAN?, cancelled :: BOOLEAN?)", + "apoc.periodic.schedule('name',statement,repeat-time-in-seconds) submit a repeatedly-called background statement", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.periodic.rock_n_roll", + "apoc.periodic.rock_n_roll(cypherIterate :: STRING?, cypherAction :: STRING?, batchSize :: INTEGER?) :: (batches :: INTEGER?, total :: INTEGER?, timeTaken :: INTEGER?, committedOperations :: INTEGER?, failedOperations :: INTEGER?, failedBatches :: INTEGER?, errorMessages :: MAP?, batch :: MAP?, operations :: MAP?)", + "apoc.periodic.rock_n_roll('some cypher for iteration', 'some cypher as action on each iteration', 10000) YIELD batches, total - run the action statement in batches over the iterator statement's results in a separate thread. Returns number of batches and total processed rows", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.periodic.rock_n_roll_while", + "apoc.periodic.rock_n_roll_while(cypherLoop :: STRING?, cypherIterate :: STRING?, cypherAction :: STRING?, batchSize :: INTEGER?) :: (loop :: ANY?, batches :: INTEGER?, total :: INTEGER?)", + "apoc.periodic.rock_n_roll_while('some cypher for knowing when to stop', 'some cypher for iteration', 'some cypher as action on each iteration', 10000) YIELD batches, total - run the action statement in batches over the iterator statement's results in a separate thread. Returns number of batches and total processed rows", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.periodic.submit", + "apoc.periodic.submit(name :: STRING?, statement :: STRING?) :: (name :: STRING?, delay :: INTEGER?, rate :: INTEGER?, done :: BOOLEAN?, cancelled :: BOOLEAN?)", + "apoc.periodic.submit('name',statement) - submit a one-off background statement", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.categorize", + "apoc.refactor.categorize(sourceKey :: STRING?, type :: STRING?, outgoing :: BOOLEAN?, label :: STRING?, targetKey :: STRING?, copiedKeys :: LIST? OF STRING?, batchSize :: INTEGER?) :: VOID", + "apoc.refactor.categorize(sourceKey, type, outgoing, label, targetKey, copiedKeys, batchSize) turn each unique propertyKey into a category node and connect to it", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.cloneNodes", + "apoc.refactor.cloneNodes(nodes :: LIST? OF NODE?) :: (input :: INTEGER?, output :: NODE?, error :: STRING?)", + "apoc.refactor.cloneNodes([node1,node2,...]) clone nodes with their labels and properties", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.cloneNodesWithRelationships", + "apoc.refactor.cloneNodesWithRelationships(nodes :: LIST? OF NODE?) :: (input :: INTEGER?, output :: NODE?, error :: STRING?)", + "apoc.refactor.cloneNodesWithRelationships([node1,node2,...]) clone nodes with their labels, properties and relationships", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.collapseNode", + "apoc.refactor.collapseNode(nodes :: ANY?, type :: STRING?) :: (input :: INTEGER?, output :: RELATIONSHIP?, error :: STRING?)", + "apoc.refactor.collapseNode([node1,node2],'TYPE') collapse node to relationship, node with one rel becomes self-relationship", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.extractNode", + "apoc.refactor.extractNode(relationships :: ANY?, labels :: LIST? OF STRING?, outType :: STRING?, inType :: STRING?) :: (input :: INTEGER?, output :: NODE?, error :: STRING?)", + "apoc.refactor.extractNode([rel1,rel2,...], [labels],'OUT','IN') extract node from relationships", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.from", + "apoc.refactor.from(relationship :: RELATIONSHIP?, newNode :: NODE?) :: (input :: INTEGER?, output :: RELATIONSHIP?, error :: STRING?)", + "apoc.refactor.from(rel, startNode) redirect relationship to use new start-node", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.invert", + "apoc.refactor.invert(relationship :: RELATIONSHIP?) :: (input :: INTEGER?, output :: RELATIONSHIP?, error :: STRING?)", + "apoc.refactor.invert(rel) inverts relationship direction", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.mergeNodes", + "apoc.refactor.mergeNodes(nodes :: LIST? OF NODE?) :: (node :: NODE?)", + "apoc.refactor.mergeNodes([node1,node2]) merge nodes onto first in list", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.normalizeAsBoolean", + "apoc.refactor.normalizeAsBoolean(entity :: ANY?, propertyKey :: STRING?, true_values :: LIST? OF ANY?, false_values :: LIST? OF ANY?) :: VOID", + "apoc.refactor.normalizeAsBoolean(entity, propertyKey, true_values, false_values) normalize/convert a property to be boolean", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.setType", + "apoc.refactor.setType(relationship :: RELATIONSHIP?, newType :: STRING?) :: (input :: INTEGER?, output :: RELATIONSHIP?, error :: STRING?)", + "apoc.refactor.setType(rel, 'NEW-TYPE') change relationship-type", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.refactor.to", + "apoc.refactor.to(relationship :: RELATIONSHIP?, newNode :: NODE?) :: (input :: INTEGER?, output :: RELATIONSHIP?, error :: STRING?)", + "apoc.refactor.to(rel, endNode) redirect relationship to use new end-node", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.schema.assert", + "apoc.schema.assert(indexes :: MAP?, constraints :: MAP?) :: (label :: STRING?, key :: LIST? OF STRING?, unique :: BOOLEAN?, action :: STRING?)", + "", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.schema.properties.distinct", + "apoc.schema.properties.distinct(label :: STRING?, key :: STRING?) :: (value :: LIST? OF ANY?)", + "apoc.schema.properties.distinct(label, key) - quickly returns all distinct values for a given key", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.search.multiSearchReduced", + "apoc.search.multiSearchReduced(LabelPropertyMap :: ANY?, operator :: STRING?, value :: STRING?) :: (id :: INTEGER?, labels :: LIST? OF STRING?, values :: MAP?)", + "Do a parallel search over multiple indexes returning a reduced representation of the nodes found: node id, labels and the searched properties. apoc.search.multiSearchReduced( map of label and properties which will be searched upon, operator: EXACT | CONTAINS | STARTS WITH | ENDS WITH, searchValue ). Multiple search results for the same node are merged into one record.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.search.node", + "apoc.search.node(LabelPropertyMap :: ANY?, operator :: STRING?, value :: STRING?) :: (node :: NODE?)", + "Do a parallel search over multiple indexes returning nodes. usage apoc.search.node( map of label and properties which will be searched upon, operator: EXACT | CONTAINS | STARTS WITH | ENDS WITH, searchValue ) returns all the DISTINCT Nodes found in the different searches.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.search.nodeAll", + "apoc.search.nodeAll(LabelPropertyMap :: ANY?, operator :: STRING?, value :: STRING?) :: (node :: NODE?)", + "Do a parallel search over multiple indexes returning nodes. usage apoc.search.nodeAll( map of label and properties which will be searched upon, operator: EXACT | CONTAINS | STARTS WITH | ENDS WITH, searchValue ) returns all the Nodes found in the different searches.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.search.nodeAllReduced", + "apoc.search.nodeAllReduced(LabelPropertyMap :: ANY?, operator :: STRING?, value :: ANY?) :: (id :: INTEGER?, labels :: LIST? OF STRING?, values :: MAP?)", + "Do a parallel search over multiple indexes returning a reduced representation of the nodes found: node id, labels and the searched property. apoc.search.nodeShortAll( map of label and properties which will be searched upon, operator: EXACT / CONTAINS / STARTS WITH | ENDS WITH / = / <> / < / > ..., value ). All 'hits' are returned.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.search.nodeReduced", + "apoc.search.nodeReduced(LabelPropertyMap :: ANY?, operator :: STRING?, value :: STRING?) :: (id :: INTEGER?, labels :: LIST? OF STRING?, values :: MAP?)", + "Do a parallel search over multiple indexes returning a reduced representation of the nodes found: node id, labels and the searched properties. apoc.search.nodeReduced( map of label and properties which will be searched upon, operator: EXACT | CONTAINS | STARTS WITH | ENDS WITH, searchValue ). Multiple search results for the same node are merged into one record.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.spatial.geocode", + "apoc.spatial.geocode(location :: STRING?, maxResults :: INTEGER?) :: (location :: MAP?, data :: MAP?, latitude :: FLOAT?, longitude :: FLOAT?, description :: STRING?)", + "apoc.spatial.geocode('address') YIELD location, latitude, longitude, description, osmData - look up geographic location of address from openstreetmap geocoding service", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.spatial.geocodeOnce", + "apoc.spatial.geocodeOnce(location :: STRING?) :: (location :: MAP?, data :: MAP?, latitude :: FLOAT?, longitude :: FLOAT?, description :: STRING?)", + "apoc.spatial.geocodeOnce('address') YIELD location, latitude, longitude, description, osmData - look up geographic location of address from openstreetmap geocoding service", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.spatial.sortByDistance", + "apoc.spatial.sortByDistance(paths :: LIST? OF PATH?) :: (path :: PATH?, distance :: FLOAT?)", + "apoc.spatial.sortPathsByDistance(List) sort the given paths based on the geo informations (lat/long) in ascending order", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.static.get", + "apoc.static.get(key :: STRING?) :: (value :: ANY?)", + "apoc.static.get(name) - returns statically stored value from config (apoc.static.) or server lifetime storage", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.static.getAll", + "apoc.static.getAll(prefix :: STRING?) :: (value :: MAP?)", + "apoc.static.getAll(prefix) - returns statically stored values from config (apoc.static..*) or server lifetime storage", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.static.list", + "apoc.static.list(prefix :: STRING?) :: (key :: STRING?, value :: ANY?)", + "apoc.static.list(prefix) - returns statically stored values from config (apoc.static..*) or server lifetime storage", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.static.set", + "apoc.static.set(key :: STRING?, value :: ANY?) :: (value :: ANY?)", + "apoc.static.set(name, value) - stores value under key for server livetime storage, returns previously stored or configured value", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.text.format", + "apoc.text.format(text :: STRING?, params :: LIST? OF ANY?) :: (value :: STRING?)", + "apoc.text.format(text,[params]) YIELD value - sprintf format the string with the params given", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.text.lpad", + "apoc.text.lpad(text :: STRING?, count :: INTEGER?, delim :: STRING?) :: (value :: STRING?)", + "apoc.text.lpad(text,count,delim) YIELD value - left pad the string to the given width", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.text.phonetic", + "apoc.text.phonetic(value :: ANY?) :: (value :: STRING?)", + "apoc.text.phonetic(value) yield value - Compute the US_ENGLISH phonetic soundex encoding of all words of the text value which can be a single string or a list of strings", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.text.phoneticDelta", + "apoc.text.phoneticDelta(text1 :: STRING?, text2 :: STRING?) :: (phonetic1 :: STRING?, phonetic2 :: STRING?, delta :: INTEGER?)", + "apoc.text.phoneticDelta(text1, text2) yield phonetic1, phonetic2, delta - Compute the US_ENGLISH soundex character difference between two given strings", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.text.rpad", + "apoc.text.rpad(text :: STRING?, count :: INTEGER?, delim :: STRING?) :: (value :: STRING?)", + "apoc.text.rpad(text,count,delim) YIELD value - right pad the string to the given width", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.trigger.add", + "apoc.trigger.add(name :: STRING?, statement :: STRING?, selector :: MAP?) :: (name :: STRING?, query :: STRING?, selector :: MAP?, installed :: BOOLEAN?)", + "", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.trigger.list", + "apoc.trigger.list() :: (name :: STRING?, query :: STRING?, selector :: MAP?, installed :: BOOLEAN?)", + "", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.trigger.remove", + "apoc.trigger.remove(name :: STRING?) :: (name :: STRING?, query :: STRING?, selector :: MAP?, installed :: BOOLEAN?)", + "", + ["publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.util.sleep", + "apoc.util.sleep(duration :: INTEGER?) :: VOID", + "apoc.util.sleep() | sleeps for millis, transaction termination is honored", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "apoc.warmup.run", + "apoc.warmup.run() :: (pageSize :: INTEGER?, nodesPerPage :: INTEGER?, nodesTotal :: INTEGER?, nodePages :: INTEGER?, nodesTime :: INTEGER?, relsPerPage :: INTEGER?, relsTotal :: INTEGER?, relPages :: INTEGER?, relsTime :: INTEGER?, totalTime :: INTEGER?)", + "apoc.warmup.run() - quickly loads all nodes and rels into memory by skipping one page at a time", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "db.awaitIndex", + "db.awaitIndex(index :: STRING?, timeOutSeconds = 300 :: INTEGER?) :: VOID", + "Wait for an index to come online (for example: CALL db.awaitIndex(\":Person(name)\")).", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "db.constraints", + "db.constraints() :: (description :: STRING?)", + "List all constraints in the database.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "db.indexes", + "db.indexes() :: (description :: STRING?, state :: STRING?, type :: STRING?)", + "List all indexes in the database.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "db.labels", + "db.labels() :: (label :: STRING?)", + "List all labels in the database.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "db.propertyKeys", + "db.propertyKeys() :: (propertyKey :: STRING?)", + "List all property keys in the database.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "db.relationshipTypes", + "db.relationshipTypes() :: (relationshipType :: STRING?)", + "List all relationship types in the database.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "db.resampleIndex", + "db.resampleIndex(index :: STRING?) :: VOID", + "Schedule resampling of an index (for example: CALL db.resampleIndex(\":Person(name)\")).", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "db.resampleOutdatedIndexes", + "db.resampleOutdatedIndexes() :: VOID", + "Schedule resampling of all outdated indexes.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "db.schema", + "db.schema() :: (nodes :: LIST? OF NODE?, relationships :: LIST? OF RELATIONSHIP?)", + "Show the schema of the data.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.changePassword", + "dbms.changePassword(password :: STRING?) :: VOID", + "Change the current user's password. Deprecated by dbms.security.changePassword.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.components", + "dbms.components() :: (name :: STRING?, versions :: LIST? OF STRING?, edition :: STRING?)", + "List DBMS components and their versions.", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.functions", + "dbms.functions() :: (name :: STRING?, signature :: STRING?, description :: STRING?, roles :: LIST? OF STRING?)", + "List all user functions in the DBMS.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.killQueries", + "dbms.killQueries(ids :: LIST? OF STRING?) :: (queryId :: STRING?, username :: STRING?)", + "Kill all transactions executing a query with any of the given query ids.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.killQuery", + "dbms.killQuery(id :: STRING?) :: (queryId :: STRING?, username :: STRING?)", + "Kill all transactions executing the query with the given query id.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.listQueries", + "dbms.listQueries() :: (queryId :: STRING?, username :: STRING?, query :: STRING?, parameters :: MAP?, startTime :: STRING?, elapsedTime :: STRING?, connectionDetails :: STRING?, metaData :: MAP?)", + "List all queries currently executing at this instance that are visible to the user.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.procedures", + "dbms.procedures() :: (name :: STRING?, signature :: STRING?, description :: STRING?, roles :: LIST? OF STRING?)", + "List all procedures in the DBMS.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.queryJmx", + "dbms.queryJmx(query :: STRING?) :: (name :: STRING?, description :: STRING?, attributes :: MAP?)", + "Query JMX management data by domain and name. For instance, \"org.neo4j:*\"", + ["reader", "publisher", "architect", "admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.activateUser", + "dbms.security.activateUser(username :: STRING?, requirePasswordChange = true :: BOOLEAN?) :: VOID", + "Activate a suspended user.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.addRoleToUser", + "dbms.security.addRoleToUser(roleName :: STRING?, username :: STRING?) :: VOID", + "Assign a role to the user.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.changePassword", + "dbms.security.changePassword(password :: STRING?, requirePasswordChange = false :: BOOLEAN?) :: VOID", + "Change the current user's password.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.changeUserPassword", + "dbms.security.changeUserPassword(username :: STRING?, newPassword :: STRING?, requirePasswordChange = true :: BOOLEAN?) :: VOID", + "Change the given user's password.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.clearAuthCache", + "dbms.security.clearAuthCache() :: VOID", + "Clears authentication and authorization cache.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.createRole", + "dbms.security.createRole(roleName :: STRING?) :: VOID", + "Create a new role.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.createUser", + "dbms.security.createUser(username :: STRING?, password :: STRING?, requirePasswordChange = true :: BOOLEAN?) :: VOID", + "Create a new user.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.deleteRole", + "dbms.security.deleteRole(roleName :: STRING?) :: VOID", + "Delete the specified role. Any role assignments will be removed.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.deleteUser", + "dbms.security.deleteUser(username :: STRING?) :: VOID", + "Delete the specified user.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.listRoles", + "dbms.security.listRoles() :: (role :: STRING?, users :: LIST? OF STRING?)", + "List all available roles.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.listRolesForUser", + "dbms.security.listRolesForUser(username :: STRING?) :: (value :: STRING?)", + "List all roles assigned to the specified user.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.listUsers", + "dbms.security.listUsers() :: (username :: STRING?, roles :: LIST? OF STRING?, flags :: LIST? OF STRING?)", + "List all local users.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.listUsersForRole", + "dbms.security.listUsersForRole(roleName :: STRING?) :: (value :: STRING?)", + "List all users currently assigned the specified role.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.removeRoleFromUser", + "dbms.security.removeRoleFromUser(roleName :: STRING?, username :: STRING?) :: VOID", + "Unassign a role from the user.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.showCurrentUser", + "dbms.security.showCurrentUser() :: (username :: STRING?, roles :: LIST? OF STRING?, flags :: LIST? OF STRING?)", + "Show the current user.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.security.suspendUser", + "dbms.security.suspendUser(username :: STRING?) :: VOID", + "Suspend the specified user.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + }, + { + "row": [ + "dbms.setTXMetaData", + "dbms.setTXMetaData(data :: MAP?) :: VOID", + "Attaches a map of data to the transaction. The data will be printed when listing queries, and inserted into the query log.", + ["admin"] + ], + "meta": [null, null, null, null], + "graph": { "nodes": [], "relationships": [] } + } + ], + "stats": { + "nodes_created": 0, + "nodes_deleted": 0, + "relationships_created": 0, + "relationships_deleted": 0, + "properties_set": 0, + "labels_added": 0, + "labels_removed": 0, + "indexes_added": 0, + "indexes_removed": 0, + "constraints_added": 0, + "constraints_removed": 0, + "contains_updates": false + } +} diff --git a/src/components/comander/cypher/common.js b/src/components/comander/cypher/common.js new file mode 100644 index 0000000..5f8f1d7 --- /dev/null +++ b/src/components/comander/cypher/common.js @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2002-2017 "Neo Technology," + * Network Engine for Objects in Lund AB [http://neotechnology.com] + * + * This file is part of Neo4j. + * + * Neo4j is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import functions from "./_data/functions.json"; +import procedures from "./_data/procedures.json"; + +export const codeMirrorSettings = { + value: '', + mode: "application/x-cypher-query", + indentWithTabs: true, + smartIndent: false, + lineNumbers: true, + matchBrackets: true, + autofocus: true, + theme: "cypher cypher-dark", + lint: true, + styleActiveLine: false, + extraKeys: { "Ctrl-Space": "autocomplete" }, + hintOptions: { + completeSingle: false, + closeOnUnfocus: false, + alignWithWord: true, + async: true, + }, + gutters: ["cypher-hints"], + lineWrapping: true, + autoCloseBrackets: { + explode: "", + }, +}; + +export const neo4jSchema = { + consoleCommands: [ + { name: ":clear" }, + { name: ":play" }, + { name: ":help", description: "this is help command" }, + { + name: ":server", + commands: [ + { + name: "user", + commands: [{ name: "list", description: "listdesc" }, { name: "add" }], + }, + ], + }, + { name: ":schema" }, + { name: ":history" }, + { name: ":queries" }, + ], + labels: [ + ":Spacey mc spaceface", + ":Legislator", + ":State", + ":Party", + ":Body", + ":Bill", + ":Subject", + ":Committee", + ":Congress", + ], + relationshipTypes: [ + ":REPRESENTS", + ":IS_MEMBER_OF", + ":ELECTED_TO", + ":PROPOSED_DURING", + ":SPONSORED_BY", + ":VOTED ON", + ":REFERRED_TO", + ":SERVES_ON", + ":DEALS_WITH", + ], + parameters: ["age", "name", "surname"], + propertyKeys: [ + "bioguideID", + "code", + "name", + "type", + "billID", + "title", + "thomasID", + "birthday", + "wikipediaID", + "currentParty", + "state", + "votesmartID", + "fecIDs", + "republicanCount", + "otherCount", + "cspanID", + "democratCount", + "lastName", + "firstName", + "party", + "opensecretsID", + "icpsrID", + "religion", + "lisID", + "govtrackID", + "gender", + "district", + "number", + "enacted", + "officialTitle", + "vetoed", + "active", + "popularTitle", + "cosponsor", + "vote", + "jurisdiction", + "url", + "rank", + "washpostID", + ], + functions: functions.data.map((data) => ({ + name: data.row[0], + signature: data.row[1].replace(data.row[0], ""), + })), + procedures: procedures.data.map((data) => { + const name = data.row[0]; + const signature = data.row[1].replace(data.row[0], ""); + + let returnItems = []; + const matches = signature.match(/\([^)]*\) :: \((.*)\)/i); + + if (matches) { + returnItems = matches[1].split(", ").map((returnItem) => { + const returnItemMatches = returnItem.match(/(.*) :: (.*)/); + return { + name: returnItemMatches[1], + signature: returnItemMatches[2], + }; + }); + } + + return { + name, + signature, + returnItems, + }; + }), +}; diff --git a/src/components/header/Header.js b/src/components/header/Header.js index c479956..dc37006 100644 --- a/src/components/header/Header.js +++ b/src/components/header/Header.js @@ -1,24 +1,27 @@ -import React, { useContext } from 'react'; -import styles from './Header.module.css'; +import React from 'react'; +import { useCookies } from 'react-cookie'; +import { useSelector, useDispatch } from 'react-redux'; + +import allActions from '../../global/utils/store/actions'; import { RowLayout } from '../../global/layouts'; import { cls } from '../../global/utils'; -import { useCookies } from 'react-cookie'; -import { ThemeContext } from '../../global/utils/hooks/theme'; +import styles from './Header.module.css'; function Header(props) { // eslint-disable-next-line no-unused-vars const [_, __, removeCookie] = useCookies(["neo4jDash.sess"]); - const theme = useContext(ThemeContext); + const dispatch = useDispatch(); + const [theme, user] = useSelector(state => [state.currentTheme, state.currentUser]); const doLogout = () => { removeCookie('neo4jDash.sess'); - props.callback(); + dispatch(allActions.userActions.logOut()); }; const handleClick = () => { const newTheme = theme.id === 'dark' ? 'light' : 'dark'; - props.themeCallback(newTheme) + dispatch(allActions.themeActions.setCustomTheme(newTheme)); } return ( @@ -39,7 +42,7 @@ function Header(props) { brightness_2
    - Hi, {props.user}! + Hi, {user.user}!
    Logout diff --git a/src/components/login/Login.module.css b/src/components/login/Login.module.css index 8d8fe68..dd7aa97 100644 --- a/src/components/login/Login.module.css +++ b/src/components/login/Login.module.css @@ -40,10 +40,9 @@ border-radius: 4px; cursor: pointer; outline: none; - box-shadow: 0px 3px 3px 3px rgba(0,0,0,.2); + box-shadow: var(--box-decoration--shadow); } .button:hover { - box-shadow: 0px 3px 3px 3px rgba(0,0,0,.4); filter: brightness(0.99); } .button:active { diff --git a/src/components/timeline/Timeline.js b/src/components/timeline/Timeline.js index f4b4d2e..e6c6e92 100644 --- a/src/components/timeline/Timeline.js +++ b/src/components/timeline/Timeline.js @@ -23,7 +23,6 @@ function Timeline(props) { queries.map((q, idx) => ( { return nodes.reduce( @@ -27,6 +28,7 @@ function Chart (props) { const [nodes, setNodes] = useState([]); const [relationships, setRelationships] = useState([]); const [graphStyle, setGraphStyle] = useState(neoGraphStyle()); + const user = useSelector(state => state.currentUser); let _graph; let _autoCompleteCallback; @@ -101,7 +103,7 @@ function Chart (props) { ORDER BY id(o) LIMIT ${props.maxNeighbours - currentNeighbourIds.length}` - const results = await getChart(props.sessionId, query); + const results = await getChart(user.sessionId, query); const count = results.records.length > 0 ? parseInt(results.records[0].get("c").toString()) : 0; const resultGraph = extractNodesAndRelationshipsFromRecordsForOldVis(results.records, false); await autoCompleteRelationships(_graph._nodes, resultGraph.nodes); @@ -114,7 +116,7 @@ function Chart (props) { existingNodeIds = existingNodeIds.concat(newNodeIds) const query = 'MATCH (a)-[r]->(b) WHERE id(a) IN $existingNodeIds AND id(b) IN $newNodeIds RETURN r;' - const results = await getChart(props.sessionId, query); + const results = await getChart(user.sessionId, query); return { ...extractNodesAndRelationshipsFromRecordsForOldVis(results.records, false), }; diff --git a/src/global/utils.js b/src/global/utils.js index 280a924..8b1d439 100644 --- a/src/global/utils.js +++ b/src/global/utils.js @@ -6,4 +6,12 @@ export const optionalToString = (v) => export const concatUniqueStrings = (value, accum) => [value.trim()].concat(accum.filter(ac => (ac || '').trim() !== value.trim())); +export const debounce = (fn, time, context = null) => { + let pending; + return (...args) => { + if (pending) clearTimeout(pending); + pending = setTimeout(() => typeof fn === "function" && fn.apply(context, args), parseInt(time)); + }; +}; + diff --git a/src/global/utils/hooks/theme.js b/src/global/utils/hooks/theme.js deleted file mode 100644 index 474047b..0000000 --- a/src/global/utils/hooks/theme.js +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react" - -export const themes = { - light: { - id: 'light', - codemirror: 'default', - relColor: '#000' - }, - dark: { - id: 'dark', - codemirror: 'material' , - relColor: '#fff' - } -} - -export const ThemeContext = React.createContext(themes.light); - -export const manageAutoTheme = () => { - const moment = (new Date()).getHours(); - if (moment >= 7 && moment < 20) { - return 'light'; - } else { - return 'dark'; - } -} diff --git a/src/global/utils/store/actions/index.js b/src/global/utils/store/actions/index.js new file mode 100644 index 0000000..e90c54a --- /dev/null +++ b/src/global/utils/store/actions/index.js @@ -0,0 +1,9 @@ +import userActions from './user'; +import themeActions from './theme'; + +const allActions = { + userActions, + themeActions +} + +export default allActions; diff --git a/src/global/utils/store/actions/theme.js b/src/global/utils/store/actions/theme.js new file mode 100644 index 0000000..e92819c --- /dev/null +++ b/src/global/utils/store/actions/theme.js @@ -0,0 +1,18 @@ +const setAutoTheme = theme => { + return { + type: 'SET_AUTO_THEME', + payload: theme + } +}; + +const setCustomTheme = theme => { + return { + type: 'SET_THEME', + payload: theme + } +}; + +export default { + setAutoTheme, + setCustomTheme +} diff --git a/src/global/utils/store/actions/user.js b/src/global/utils/store/actions/user.js new file mode 100644 index 0000000..005d95b --- /dev/null +++ b/src/global/utils/store/actions/user.js @@ -0,0 +1,17 @@ +const setUser = userObj => { + return { + type: 'SET_USER', + payload: userObj + } +} + +const logOut = () => { + return { + type: 'LOG_OUT' + } +} + +export default { + setUser, + logOut +} diff --git a/src/global/utils/store/reducers/index.js b/src/global/utils/store/reducers/index.js new file mode 100644 index 0000000..b5c3855 --- /dev/null +++ b/src/global/utils/store/reducers/index.js @@ -0,0 +1,10 @@ +import currentUser from "./user"; +import currentTheme from './theme'; +import { combineReducers } from "redux"; + +const rootReducer = combineReducers({ + currentUser, + currentTheme +}); + +export default rootReducer; diff --git a/src/global/utils/store/reducers/theme.js b/src/global/utils/store/reducers/theme.js new file mode 100644 index 0000000..c2e517d --- /dev/null +++ b/src/global/utils/store/reducers/theme.js @@ -0,0 +1,40 @@ +const themes = { + light: { + id: "light", + codemirror: "cypher cypher-light", + relColor: "#000", + }, + dark: { + id: "dark", + codemirror: "cypher cypher-dark", + relColor: "#fff", + }, +}; + +const manageAutoTheme = () => { + const moment = new Date().getHours(); + if (moment >= 7 && moment < 20) { + return "light"; + } else { + return "dark"; + } +}; + +const currentTheme = (state = themes[manageAutoTheme()], action) => { + switch(action.type) { + case 'SET_AUTO_THEME': + return { + ...state, + ...themes[manageAutoTheme()] + }; + case 'SET_THEME': + return { + ...state, + ...themes[action.payload] + }; + default: + return state; + } +}; + +export default currentTheme; diff --git a/src/global/utils/store/reducers/user.js b/src/global/utils/store/reducers/user.js new file mode 100644 index 0000000..5f36878 --- /dev/null +++ b/src/global/utils/store/reducers/user.js @@ -0,0 +1,23 @@ +const currentUser = (state = { loggedIn: false }, action) => { + switch (action.type) { + case "SET_USER": + return { + ...state, + ...action.payload, + loggedIn: true, + }; + case "LOG_OUT": + return { + ...state, + ...{ + user: null, + sessionId: null + }, + loggedIn: false, + }; + default: + return state; + } +}; + +export default currentUser; diff --git a/src/global/utils/store/store.js b/src/global/utils/store/store.js new file mode 100644 index 0000000..8b8d338 --- /dev/null +++ b/src/global/utils/store/store.js @@ -0,0 +1,7 @@ +import { createStore } from "redux"; +import rootReducer from "./reducers"; + +export const store = createStore( + rootReducer, + window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() +); diff --git a/src/global/utils/tests/store.mock.js b/src/global/utils/tests/store.mock.js new file mode 100644 index 0000000..8348544 --- /dev/null +++ b/src/global/utils/tests/store.mock.js @@ -0,0 +1,27 @@ +import React from "react"; +import { Provider } from "react-redux"; +import configureStore from "redux-mock-store"; + +export const getMockProvider = (partialState) => { + const mockStore = configureStore(); + const store = mockStore({ + currentTheme: {}, + currentUser: { user: null, loggedIn: false } + }); + + return { + MockProvider: ({ children }) => {children}, + store, + }; +}; + +export const setup = (partialState) => { + const { MockProvider } = getMockProvider(partialState); + + // the other mocking you want to do like a custom hook + + return { + MockProvider, + // you can return all mock instance from here, so you assert then in the tests + }; +}; diff --git a/src/index.js b/src/index.js index caf5a5c..66e0729 100644 --- a/src/index.js +++ b/src/index.js @@ -1,16 +1,20 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import { Provider } from 'react-redux'; import './index.css'; import './global/flex.css'; import './global/autosuggest.css'; +import { store } from './global/utils/store/store'; import App from './App'; import * as serviceWorker from './serviceWorker'; ReactDOM.render( - - - , - document.getElementById('root') + + + + + , + document.getElementById("root") ); // If you want your app to work offline and load faster, you can change