Skip to content

Clean option drops entire mongo database #11

@Lewwwk

Description

@Lewwwk

Currently, passing the clean option to load or create drops the entire mongo database. This can cause disastrous effects.

Expected Behavior

Clean should only drop the facts collection in the database and not affect the rest of the database. Currently, that collection is called mongodown.

Current Behavior

Currently it executes db.dropDatabase() when clean is specified.

Possible Solution

Changing to db.mongodown.drop() would drop only the collection.

Steps to Reproduce (for bugs)

Can test by creating a superscript bot, triggering an action that would create a fact, then triggering a load or create action with clean=true

Context

If triggered unexpectedly, it could cause catastrophic data loss.

Your Environment

All the shiniest node, mongo, superscript.

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