package
Version:
v1.0.2
Opens a new window with list of versions in this module.
Published: Sep 23, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package mongodb contains the domain concept definitions needed to support
Magistrala Mongo database functionality.
It provides the abstraction of the Mongo database service, which is used
to configure, setup and connect to the Mongo database.
Connect creates a connection to the MongoDB instance.
Setup load configuration from environment, create new MongoDB client and connect to MongoDB server.
type Config struct {
Host string `env:"HOST" envDefault:"localhost"`
Port string `env:"PORT" envDefault:"27017"`
Name string `env:"NAME" envDefault:"messages"`
}
Config defines the options that are used when connecting to a MongoDB instance.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.