Big Data & Tools with NoSQL
  • Big Data & Tools
  • ReadMe
  • Big Data Overview
    • Overview
    • Job Opportunities
    • What is Data?
    • How does it help?
    • Types of Data
    • The Big 4 V's
      • Variety
      • Volume
      • Velocity
      • Veracity
      • Other V's
    • Trending Technologies
    • Big Data Concerns
    • Big Data Challenges
    • Data Integration
    • Scaling
      • CAP Theorem
      • Optimistic concurrency
      • Eventual consistency
      • Concurrent vs. Parallel Programming
    • Big Data Tools
    • No SQL Databases
    • What does Big Data learning means?
  • Linux & Tools
    • Overview
    • Linux Commands - 01
    • Linux Commands - 02
    • AWK
    • CSVKIT
    • CSVSQL
    • CSVGREP
  • Data Format
    • Storage Formats
    • CSV/TSV/Parquet
    • Parquet Example
    • JSON
    • HTTP & REST API
      • Terms to Know
        • Statefulness
        • Statelessness
        • Monolithic Architecture
        • Microservices
        • Idempotency
    • REST API
    • Python
      • Setup
      • Decorator
      • Unit Testing
      • Flask Demo
      • Flask Demo - 01
      • Flask Demo - 02
      • Flask Demo - 03
      • Flask Demo - 04
      • Flask Demo - 06
    • API Testing
    • Flask Demo Testing
    • API Performance
    • API in Big Data World
  • NoSQL
    • Types of NoSQL Databases
    • Redis
      • Overview
      • Terms to know
      • Redis - (RDBMS) MySql
      • Redis Cache Demo
      • Use Cases
      • Data Structures
        • Strings
        • List
        • Set
        • Hash
        • Geospatial Index
        • Pub/Sub
        • Redis - Python
      • Redis JSON
      • Redis Search
      • Persistence
      • Databases
      • Timeseries
    • Neo4J
      • Introduction
      • Neo4J Terms
      • Software
      • Neo4J Components
      • Hello World
      • Examples
        • MySQL: Neo4J
        • Sample Transactions
        • Sample
        • Create Nodes
        • Update Nodes
        • Relation
        • Putting it all together
        • Commonly used Functions
        • Data Profiling
        • Queries
        • Python Scripts
      • More reading
    • MongoDB
      • Sample JSON
      • Introduction
      • Software
      • MongoDB Best Practices
      • MongoDB Commands
      • Insert Document
      • Querying MongoDB
      • Update & Remove
      • Import
      • Logical Operators
      • Data Types
      • Operators
      • Aggregation Pipeline
      • Further Reading
      • Fun Task
        • Sample
    • InfluxDB
      • Data Format
      • Scripts
  • Python
    • Python Classes
    • Serialization-Deserialization
  • Tools
    • JQ
    • DUCK DB
    • CICD Intro
    • CICD Tools
      • CI YAML
      • CD Yaml
    • Containers
      • VMs or Containers
      • What container does
      • Podman
      • Podman Examples
  • Cloud Everywhere
    • Overview
    • Types of Cloud Services
    • Challenges of Cloud Computing
    • High Availability
    • Azure Cloud
      • Services
      • Storages
      • Demo
    • Terraform
  • Data Engineering
    • Batch vs Streaming
    • Kafka
      • Introduction
      • Kafka Use Cases
      • Kafka Software
      • Python Scripts
      • Different types of Streaming
    • Quality & Governance
    • Medallion Architecture
    • Data Engineering Model
    • Data Mesh
  • Industry Trends
    • Roadmap - Data Engineer
    • Good Reads
      • IP & SUBNET
Powered by GitBook
On this page
  1. NoSQL
  2. Neo4J
  3. Examples

Commonly used Functions

String Functions

match (a) return toUpper(a.firstname);


RETURN left('hello', 3)

RETURN lTrim('   hello')

RETURN replace("hello", "l", "w")

RETURN reverse('hello')

RETURN substring('hello', 1, 3), substring('hello', 2)


RETURN toString(11.5),
toString('already a string'),
toString(true),
toString(date({year:1984, month:10, day:11})) AS dateString,
toString(datetime({year:1984, month:10, day:11, hour:12, minute:31, second:14, millisecond: 341, timezone: 'Europe/Stockholm'})) AS datetimeString,
toString(duration({minutes: 12, seconds: -60})) AS durationString

Aggregation Functions

  • COUNT: Counts the number of items.

    MATCH (n:Student)
    RETURN COUNT(n);
  • MAX and MIN: Find the maximum or minimum of a set of values.

    MATCH (n:Student)-[r:TAKING]->(c)
    RETURN MAX(r.grade), MIN(r.grade);

Date and Time Functions

  • date(): Creates a date from a string or a map.

    RETURN date('2024-03-20');
  • datetime(): Creates a datetime from a string or a map.

    RETURN datetime('2024-03-20T12:00:00');
  • duration.between(): Calculates the duration between two temporal values.

    RETURN duration.between(date('1984-10-11'), date('2024-03-20'));

List Functions

  • COLLECT: Aggregates values into a list.

    MATCH (n:Student)
    RETURN COLLECT(n.firstname);
  • SIZE: Returns the size of a list.

    MATCH (n:Student)
    RETURN COLLECT(n.firstname), SIZE(COLLECT(n.firstname));
  • RANGE: Creates a list containing a sequence of integers.

    RETURN RANGE(1, 10, 2);

Mathematical Functions

  • ABS: Returns the absolute value.

    RETURN ABS(-42);
  • ROUND, CEIL, FLOOR: Round numbers to the nearest integer, up, or down.

    RETURN ROUND(3.14159), CEIL(3.14159), FLOOR(3.14159);

Logical Functions

  • COALESCE: Returns the first non-null value in a list of expressions.

    RETURN COALESCE(NULL, 'first non-null', NULL);

Spatial Functions

  • point: Creates a point in a 2D space (or 3D if you add elevation) which can be used for spatial queries.

    RETURN point({latitude: 37.4847, longitude: -122.148})
  • RETURN point.distance(
      point({latitude: 39.94, longitude: -75.01}), 
      point({latitude: 39.97, longitude: -74.96})
    ) / 1609.34 AS distanceInMiles
  • apoc.coll.sort: Sorts a list.

    RETURN apoc.coll.sort(['banana', 'apple', 'cherry'])
  • apoc.map.merge: Merges two maps.

    RETURN apoc.map.merge({name: 'Neo'}, {age: 23})

PreviousPutting it all togetherNextData Profiling

Last updated 1 year ago

distance: Calculates the geodesic distance between two points in Meters. Cherryhill to Moorestown. Verify the result

https://www.nhc.noaa.gov/gccalc.shtml