# System.mongodb calls fail despite having the connector installed and status Valid

**URL:** <https://forum.inductiveautomation.com/t/system-mongodb-calls-fail-despite-having-the-connector-installed-and-status-valid/77903>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [August 16, 2023, 12:18am UTC](https://forum.inductiveautomation.com/t/system-mongodb-calls-fail-despite-having-the-connector-installed-and-status-valid/77903 "2023-08-16T00:18:17Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![sherman](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sherman](https://forum.inductiveautomation.com/u/sherman)\
**Post date:** [August 16, 2023, 9:55pm UTC](https://forum.inductiveautomation.com/t/system-mongodb-calls-fail-despite-having-the-connector-installed-and-status-valid/77903/21 "2023-08-16T21:55:56Z")

</div>

Strangely enough if I `return dir(MyScripts)`, from `handleMessage()`, it leads with a list of all of the objects at the same level -- namely my other Project Library contents. I would have expected it to return only the fuctions _within_ the `MyScripts` library. The object seems to have been injected with references to its peers somehow.

```auto
return getattr(someLibraryScript, payload.pop('functionNameKey'))(payload)

```

This is an improvement, an intermediate solution. It would let me abstract into a given library without access to every library (except for the apparent knowledge of its neighbors?).

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 16, 2023, 9:57pm UTC](https://forum.inductiveautomation.com/t/system-mongodb-calls-fail-despite-having-the-connector-installed-and-status-valid/77903/22 "2023-08-16T21:57:52Z")

</div>

> [@sherman](#):
>
> The object seems to have been injected with references to its peers somehow.

You are importing them, I presume. Don't do that.

Every name you create at the top level of a library script is in that script's globals() dictionary. Whether you assign it, `def` a function, declare a class, or import from elsewhere.

---

<div class="post-metadata">

**Author:** ![sherman](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sherman](https://forum.inductiveautomation.com/u/sherman)\
**Post date:** [August 16, 2023, 10:00pm UTC](https://forum.inductiveautomation.com/t/system-mongodb-calls-fail-despite-having-the-connector-installed-and-status-valid/77903/23 "2023-08-16T22:00:26Z")

</div>

The the library `MyScripts` only has `import socket` and `import sys` and only within defined functions.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 16, 2023, 10:01pm UTC](https://forum.inductiveautomation.com/t/system-mongodb-calls-fail-despite-having-the-connector-installed-and-status-valid/77903/24 "2023-08-16T22:01:58Z")

</div>

> [@sherman](#):
>
> only has `import socket` and `import sys` and only

No assignments?

---

<div class="post-metadata">

**Author:** ![sherman](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sherman](https://forum.inductiveautomation.com/u/sherman)\
**Post date:** [August 16, 2023, 10:03pm UTC](https://forum.inductiveautomation.com/t/system-mongodb-calls-fail-despite-having-the-connector-installed-and-status-valid/77903/25 "2023-08-16T22:03:20Z")

</div>

Nope, that library is mostly full of helper methods that I am using to tinker, like "send\_tcp".

[Previous page](https://forum.inductiveautomation.com/t/system-mongodb-calls-fail-despite-having-the-connector-installed-and-status-valid/77903.md?page=1)
