Skip to content

[falcor] world -> character, and character -> world #31

@joshdmiller

Description

@joshdmiller

Overview

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

Specs

The details of characters still come from MongoDB. It is only their association to worlds (and other entities, in other GH issues) that is stored in Neo4j. The _id property in neo will be the same as the _id property in MongoDB.

Character Length

The current length of characters comes from the length of the array in the mongo document. Instead, this should come from the set of non-archived characters (see #12 and #11) that have the HAS relationship from the world in question, ordered by their creation date.

Characters By Index

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

Push Character

Characters are created by pushing to the array in mongo. Instead, once the character itself is stored in mongo, the relationship should be added to neo:

(:World)-[:HAS {HasProps}]->(:Character {CharacterProps})

With the following properties:

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

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

Delete Character

Characters are currently deleted by removing the document in Mongo and deleting it from the array in the world. Instead, the Mongo document should be archived (see #13) and the node in neo4j should be archived (see #12).

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