Coverage for mindsdb / integrations / handlers / mongodb_handler / connection_args.py: 100%
4 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-21 00:36 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-21 00:36 +0000
1from collections import OrderedDict
3from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE as ARG_TYPE
6connection_args = OrderedDict(
7 username={
8 'type': ARG_TYPE.STR,
9 'description': 'The username used to authenticate with the MongoDB server.',
10 'required': True,
11 'label': 'User'
12 },
13 password={
14 'type': ARG_TYPE.PWD,
15 'description': 'The password to authenticate the user with the MongoDB server.',
16 'required': True,
17 'label': 'Password',
18 'secret': True
19 },
20 database={
21 'type': ARG_TYPE.STR,
22 'description': 'The database name to use when connecting with the MongoDB server.',
23 'required': False,
24 'label': 'Database'
25 },
26 host={
27 'type': ARG_TYPE.STR,
28 'description': 'The host name or IP address of the MongoDB server. NOTE: use \'127.0.0.1\' instead of \'localhost\' to connect to local server.',
29 'required': True,
30 'label': 'Host'
31 },
32 port={
33 'type': ARG_TYPE.INT,
34 'description': 'The TCP/IP port of the MongoDB server. Must be an integer.',
35 'required': True,
36 'label': 'Port'
37 },
38)
40connection_args_example = OrderedDict(
41 host='127.0.0.1',
42 port=27017,
43 username='mongo',
44 password='password',
45 database='database'
46)