run_batch_query {bolt4jr}R Documentation

Batch Query and Save Data from Neo4j

Description

This function performs batch queries to a Neo4j database and appends the results to a TSV file.

Usage

run_batch_query(
  uri,
  user,
  password,
  query,
  field_names,
  filename = NULL,
  batch_size = 1000
)

Arguments

uri

A string specifying the URI for the Neo4j database connection.

user

A string specifying the username for the Neo4j database.

password

A string specifying the password for the Neo4j database.

query

A string containing the Cypher query to execute. The query should not include SKIP or LIMIT, as these are appended for batching.

field_names

A character vector specifying the column names to use for the resulting data.

filename

A string specifying the name of the TSV file to save the results. If NULL, a temporary file will be used.

batch_size

An integer specifying the number of records to fetch per batch. Default is 1000.

Value

No return value, called for side effects.

Examples

## Not run: 
run_batch_query(
  uri = "bolt://localhost:7687",
  user = "<Username for Neo4j>",
  password = "<Password for Neo4j>",
  query = "MATCH (n) RETURN n LIMIT 10",
  field_names = c("id", "name"),
  filename = NULL,  # Writes to a temp file by default
  batch_size = 1000
)

## End(Not run)

[Package bolt4jr version 1.4.0 Index]