Skip to content

Instantly share code, notes, and snippets.

@Lcfvs
Created April 24, 2016 10:07
Show Gist options
  • Select an option

  • Save Lcfvs/a60066f42823225eaafc0c75614cdea5 to your computer and use it in GitHub Desktop.

Select an option

Save Lcfvs/a60066f42823225eaafc0c75614cdea5 to your computer and use it in GitHub Desktop.
import * as mongoose from 'mongoose';
console.log(mongoose.connect); // undefined
// but
console.log(mongoose);
/*
{ connections:
[ NativeConnection {
base: [Object],
collections: {},
models: {},
config: [Object],
replica: false,
hosts: null,
host: null,
port: null,
user: null,
pass: null,
name: null,
options: null,
otherDbs: [],
_readyState: 0,
_closeCalled: false,
_hasOpened: false,
_listening: false } ],
plugins: [],
models: {},
modelSchemas: {},
options: { pluralization: true },
default:
Mongoose {
connections: [ [Object] ],
plugins: [],
models: {},
modelSchemas: {},
options: { pluralization: true } } }
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment