Skip to content

[falcor] migrate user -> worlds to neo4j #29

Description

@joshdmiller

Overview

Migrate falcor routes pertaining to a user's worlds to get the database relationships using Neo4j.

Specs

The details of worlds still come from MongoDB. It is only their association to users (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.

User Worlds Length

The current length of user's worlds 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) ROLE relationships from this user to a world, ordered by their creation date.

User Worlds By Index

The current means of fetching individual worlds in relation to a user is by their index position in the array. This array should become the ordered set of worlds that follow the above logic.

Push New World Relationship

Worlds are created by pushing to the array in mongo. Instead, the world document will still be created in mongo, but the relationship between users and worlds will be tracked in neo with no mongo equivalent.

(:User)-[:ROLE {RoleProps}]->(:World)

With the following properties:

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

// In MongoDB
type WorldProps = {
  _id: string,
  title: 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