# How to connect to FoundationDB with MongoDB CLI?

**URL:** <https://forums.foundationdb.org/t/how-to-connect-to-foundationdb-with-mongodb-cli/977>\
**Category:** Document Layer\
**Created:** [December 28, 2018, 3:06pm UTC](https://forums.foundationdb.org/t/how-to-connect-to-foundationdb-with-mongodb-cli/977 "2018-12-28T15:06:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xet7](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/xet7/32/460_2.png) [@xet7](https://forums.foundationdb.org/u/xet7)\
**Post date:** [December 28, 2018, 3:06pm UTC](https://forums.foundationdb.org/t/how-to-connect-to-foundationdb-with-mongodb-cli/977/1 "2018-12-28T15:06:54Z")

</div>

Hi,  
I installed these packages, tried on Ubuntu 18.04 and Linux Mint 19.1:

- fdb-document-layer\_1.6.0-1\_amd64.deb
- foundationdb-clients\_6.0.15-1\_amd64.deb
- foundationdb-server\_6.0.15-1\_amd64.deb

Then I started it with

```auto
sudo service foundationdb start

```

And this showed that it seems to be running:

```auto
sudo service foundationdb status

```

But connecting with mongodb client v3.2.11 and v3.6.3 to port 27016 does not work, it seems there is nothing running on that port. Also mongorestore does not work.

What steps am I missing?

---

<div class="post-metadata">

**Author:** ![alexmiller](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alexmiller/32/326_2.png) [@alexmiller](https://forums.foundationdb.org/u/alexmiller)\
**Post date:** [January 2, 2019, 8:46pm UTC](https://forums.foundationdb.org/t/how-to-connect-to-foundationdb-with-mongodb-cli/977/2 "2019-01-02T20:46:25Z")

</div>

You’ve started the FoundationDB service, but not the FoundationDB Document Layer service.

You can start the latter with: `sudo /etc/init.d/fdb-document-layer start`

I’d be interested in more details on your setup though, as it looks like installing fdb-document-layer should invoke a post-install script that starts the service?

(and @mbhaskar to double check the above)

---

<div class="post-metadata">

**Author:** ![xet7](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/xet7/32/460_2.png) [@xet7](https://forums.foundationdb.org/u/xet7)\
**Post date:** [January 2, 2019, 10:17pm UTC](https://forums.foundationdb.org/t/how-to-connect-to-foundationdb-with-mongodb-cli/977/3 "2019-01-02T22:17:37Z")

</div>

No, these did not start automatically, I needed to start them from /etc/init.d scripts on Ubuntu 18.04 64bit server running on bare metal server that has about 300 GB RAM, it’s from CNCF to Wekan Open Source project.

I’m maintainer of Wekan [https://wekan.github.io](https://wekan.github.io) , Wekan uses Meteor 1.8.0.1 Javascript framework with Node 8.15.0. I’m trying to find alternatives to MongoDB because of MongoDB database corruption and scalability.

When I tried Wekan with FoundationDB I did get thise errors after database creation and migrations:

```auto
> Starting add-custom-html-before-body-end migration.
> Finishing add-custom-html-before-body-end migration./home/wekan/repos/wekan/.build/bundle/programs/server/node_modules/fibers/future.js:313
                                                                     throw(ex);
                                                ^     
MongoError: "You may not modify '_id' in an update" at Function.create (/home/wekan/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:43:12)
    at toError (/home/wekan/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:149:22)
    at coll.s.topology.update (/home/wekan/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/operations/collection_ops.js:1370:39)
    at /home/wekan/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:532:18
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)

```

---

<div class="post-metadata">

**Author:** ![mbhaskar](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/mbhaskar/32/277_2.png) [@mbhaskar](https://forums.foundationdb.org/u/mbhaskar)\
**Post date:** [January 2, 2019, 11:14pm UTC](https://forums.foundationdb.org/t/how-to-connect-to-foundationdb-with-mongodb-cli/977/4 "2019-01-02T23:14:14Z")

</div>

It should have started the service after installation. That’s a bug. I could reproduce this on 16.04 as well. I have raised an [issue](https://github.com/FoundationDB/fdb-document-layer/issues/32)

Do you have the specific query that is causing the “\_id update” issue? It is not valid to update the `_id` field as it is the primary key. As far as I know, that’s the case with MongoDB as well. If you can point us to an example, we can confirm if that’s expected behavior or a bug.
