new Mongo(config, logger, util)
Create the service
Parameters:
Name | Type | Description |
---|---|---|
config |
object | Config service |
logger |
Logger | Logger service |
util |
Util | Util service |
Members
-
<static> provides :string
-
Service name is 'mongo'
Type:
- string
-
<static> requires :Array.<string>
-
Dependencies as constructor arguments
Type:
- Array.<string>
-
<static> lifecycle :string
-
This service is a singleton
Type:
- string
-
<static> datetimeFormat :string
-
Format of date/time string
Type:
- string
Methods
-
<async> connect(name)
-
Obtain Mongo client
Parameters:
Name Type Default Description name
string 'main' Server name in config Returns:
Resolves to connected MongoClient instance- Type
- Promise