Skip to content

returning mongoose object not working #3856

@nschloe

Description

@nschloe

Interestingly, when upgrading to 4.4.1 (from 4.3.x), I noticed that returning the mongoose object doesn't work anymore,

import mongoose from 'mongoose'; export const init = co.wrap(function* _init() { yield mongoose.connect( config.mongodbUri, { server: { socketOptions: { keepAlive: 1, }, }, replset: { socketOptions: { keepAlive: 1, }, }, } ); mongoose.connection.on('error', (err) => { process.exit(1); }); return mongoose; });

always returns undefined. Within this function, it's all fine; mongoose is the fat object it used to be. I'm puzzled as to why this may happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions