Skip to content

Neo4j Helper: Node Archiver #12

Description

@joshdmiller

Overview

Create a reusable function for archiving a node. Archiving should prevent a node from being used as the start of a match in the relevant queries without requiring the deletion of the node or its relationships. This allows us to maintain history without affecting the functionality of the app.

Track as part of Falcor Route creation.

Function Signature

function (
  nodeLabel : string,
  nodeId : string,
  userId : string
) : Observable<object>

Spec

GIVEN:

  • a node in the database with no incoming relationships;

WHEN provided:

  • a label on the node;
  • the ID of the node to archive;
  • the ID of the user performing this action;

THEN:

  • the function should set the following properties on the node:
{
  archived: true,
  archived_at: now(),
  archiver: userId,
}

WHEN:

  • the node has inbound relationships;

THEN:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions