Skip to content

[falcor] creating a new book in a world #10

Description

@joshdmiller

Summary

Create a falcor route to create a new book within a world.

See also #8, #9.

Authentication & Authorization

The current user must have write or owner permissions for the world in which the book is to be created.

Spec

Route (call): worldsById[id: string].books.push

Function Signature

function (  world_id : string, title : string ) : JSONGraphEnvelope

MongoDB

Create a new document for this world with the following parameters:

{
  _id : string, // randomly generated
  title: string,
  created_at: Date.now(),
  updated_at: Date.now(),
}

Neo4j

Merge (:Book)-[:IN]->(:World) with the following properties:

const Book = {
  _id: bookId,
};

const World = {
  _id: worldId,
};

const OF = {
  archived: false,
  created_at: Date.now(),
  creator: userId, // user performing the operation
};

Return Paths

Return the path to the new ref in worldsById[key: string].books per #9.

Changelog

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