Skip to content

[falcor] migrate character -> genes to neo4j #30

Description

@joshdmiller

Overview

Migrate falcor routes pertaining to character genes to get the database relationships using Neo4j.

Specs

Character genes will no longer come from MongoDB. Their association to characters and other genes as well as their details will be stored in Neo4j.

Character Genes Length

The current length of character genes comes from the length of the array in the mongo document. Instead, this should come from the set of non-archived (see #12 and #11) HAS relationships from this character to a gene, ordered by their creation date.

Character Genes By Index

The current means of fetching individual genes is by their index position in the array. This array should become the ordered set of character genes that follow the above logic.

The value at the index should no longer be an atom, but a reference to genesById[id: string].

Altering character genes is currently accomplished by altering the indexed item in the array. Instead, this should alter the gene in neo by its ID.

Push Character Gene

Character genes are created by pushing to the array in mongo. Instead, the entire relationship will be tracked in neo with no mongo equivalent:

(:Character)-[:HAS {HasProps}]->(:Gene {GeneProps})

With the following properties:

type HasProps = {
  created_at: timestamp,
  creator: string, // id of currently-authenticated user
};

type GeneProps = {
  _id: string,
  gene: string,
  allele: string,
};

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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