trait Connection extends Object with IEventEmitter
Mongoose Connection
- Annotations
- @RawJSType() @native()
- Alphabetic
- By Inheritance
- Connection
- IEventEmitter
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
collection(name: String, options: RawOptions = js.native): Unit
Retrieves a collection, creating it if not cached.
Retrieves a collection, creating it if not cached.
- name
of the collection
- options
optional collection options
- returns
the collection instance
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addListener(eventName: String, listener: Function): Connection.this.type
- Definition Classes
- IEventEmitter
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
close(callback: Function1[MongooseError, Any]): Unit
Closes the connection
-
def
close(): Promise[Any]
Closes the connection
-
def
collections: Dictionary[Collection]
A hash of the collections associated with this connection
-
def
config: Dictionary[Any]
A hash of the global options that are associated with this connection
-
def
db: Db
The mongodb.Db instance, set when the connection is opened
-
val
domain: String
- Definition Classes
- IEventEmitter
-
def
emit(name: String, args: Any*): Any
- Definition Classes
- IEventEmitter
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getMaxListeners(): Int
- Definition Classes
- IEventEmitter
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
listenerCount(eventName: String): Int
- Definition Classes
- IEventEmitter
-
def
listeners(eventName: String): Array[Function]
- Definition Classes
- IEventEmitter
-
def
model[A](name: String, schema: Schema[A] = js.native, collection: String = js.native, skipInit: Boolean = js.native): MongooseModel[A]
Models defined on the mongoose instance are available to all connection created by the same mongoose instance.
Models defined on the mongoose instance are available to all connection created by the same mongoose instance.
- name
the model name or class extending Model
- schema
the schema
- collection
the name (optional, inferred from model name)
- skipInit
indicates whether to skip initialization (defaults to false)
- returns
the model
-
def
modelNames(): Array[String]
Returns an array of model names created on this instance of Mongoose.
Returns an array of model names created on this instance of Mongoose.
- returns
an array of model names
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
on(eventName: String, listener: Function): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
once(eventName: String, listener: Function): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
plugin(callback: Function, options: RawOptions = js.native): Unit
Declares a global plugin executed on all Schemas.
Declares a global plugin executed on all Schemas.
- callback
the plugin callback
- options
the optional options
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
readyState: Int
Connection ready state
Connection ready state
- 0 = disconnected
- 1 = connected
- 2 = connecting
- 3 = disconnecting
Each state change emits its associated event name.
-
def
removeAllListeners(): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
removeAllListeners(eventName: String): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
removeListener(eventName: String, listener: Function): Connection.this.type
- Definition Classes
- IEventEmitter
-
def
set(key: String, value: Any): Unit
Sets mongoose options
Sets mongoose options
- key
the options key
- value
the the value to set or function
-
def
setMaxListeners(n: Int): Connection.this.type
- Definition Classes
- IEventEmitter
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
val
usingDomains: Boolean
- Definition Classes
- IEventEmitter
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )