Skip to content

Why is accessing the mongoose object via the plugin/pack a bad idea? #6

@jesseclark

Description

@jesseclark

Could you elucidate on why using

# from the server
mongoose = server.pack.plugins['hapi-mongoose-db-connector'].mongoose
# or from a plugin
mongoose = plugin.plugins['hapi-mongoose-db-connector'].mongoose

is a bad idea and how just requiring mongoose gives you the configured mongoose connection?

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