# Attaching MongoDB Atlas Database in DVServer 2.4

**URL:** <https://community.cdata.com/t/attaching-mongodb-atlas-database-in-dvserver-2-4/769>\
**Category:** CData Virtuality \[Archived\]\
**Tags:** article, cdata-virtuality\
**Created:** [June 10, 2024, 4:30pm UTC](https://community.cdata.com/t/attaching-mongodb-atlas-database-in-dvserver-2-4/769 "2024-06-10T16:30:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@anonymous](https://community.cdata.com/u/anonymous)\
**Post date:** [June 10, 2024, 4:30pm UTC](https://community.cdata.com/t/attaching-mongodb-atlas-database-in-dvserver-2-4/769/1 "2024-06-10T16:30:30Z")

</div>

An attempt to attache MongoDB Atlas Database source in DVServe 2.4 using web UI wizard in Pipes or Mongo DB wizard in DVStudio leads to timeout errors like the following:

```auto
Studio version: 2.4.12-SNAPSHOTServer version: 2.4.11Full technical data:com.datavirtuality.dv.gui.admin.backend.BackEndException: org.teiid.jdbc.TeiidSQLException: Message from connection template 'mongodb': Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=<host name>:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]

```

But it is possible to attach it with the script below:

```auto
begin/* Create connection */call SYSADMIN.createConnection(name => 'mongodb', jbossCliTemplateName => 'mongodb', connectionOrResourceAdapterProperties => 'server=<server host name>,port=27017,authSource=<auth source >,database=sample_training,login=<username>,password=<password>,readMode=primary,options="sslEnabled=true"', encryptedProperties => ''); /* Create data source */call SYSADMIN.createDatasource(name => 'mongodb', translator => 'mongodb', modelProperties => 'importer.useFullSchemaName=false', translatorProperties => '', encryptedModelProperties => '', encryptedTranslatorProperties => '');end;;

```

DVServer external IP addresses must be&nbsp;[whitelisted](https://docs.atlas.mongodb.com/security-whitelist/#whitelist)&nbsp;in Atlas. If an error continues to appear, the&nbsp;0.0.0.0/0 record should be tested.
