Skip to content

MongoDB Helper: Document Archiver #13

Description

@joshdmiller

Overview

Create a reusable function for archiving a document. Archiving should prevent a document from being used without requiring the deletion of the document. This allows us to maintain history without affecting the functionality of the app.

Track as part of Falcor Route creation.

Function Signature

function (
  collection : string,
  _id : string,
  userId : string
) : Observable<object>

Spec

GIVEN:

  • a document in the database;

WHEN provided:

  • the name of the collection in which the document resides;
  • the ID of the document to archive;
  • the ID of the user performing this action;

THEN:

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

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