msavin/MongoInspector — pull request #3 by rjsmith (2014-12-06 16:56:47+00:00)
Title: Support collections within nested objects

Hi,
Thanks for creating MongoInspector, looks a very useful tool.
It didn't work with my own project because I have assigned all my collections to sub-properties within a single global application object, acting as a namespace.
For example, I declare my collections like:

```javascript
var myCollection = new Mongo.Collection('mycollection');
MyApp.myCollection = myCollection;
```

So, the 'window' object only has a 'MyApp' direct property. The original MongoInspector code appeared to expect each collection name to be a first class property of 'window'. So, this pull request adds a function I found on StackExchange to recursively walk a dotted string path to return an object, and use that as the Collection object.

Also made a small alteration to package.js to ensure that the MongoInspector files are only loaded on the client.