Mongodb Collection Not Complete

15 views
Skip to first unread message

Nigel David

unread,
Jul 18, 2017, 2:54:50 PM7/18/17
to SlamData-User
I just set up SlamData hoping to use it to create dashboards for time series data in a mongodb.

One of my collections is missing a key piece of information.


Damon LaCaille

unread,
Jul 18, 2017, 3:05:50 PM7/18/17
to SlamData-User
Nigel - can you provide more details? There isn't much context here to go on.

Nigel David

unread,
Jul 18, 2017, 5:08:55 PM7/18/17
to SlamData-User



Sure. The above screenshots show the difference between my "Topics" collection as shown in SlamData (top) and in the mongo shell (bottom).

When I open the "topics" collection in Slamdata the preview does not show the id corresponding to each topic name.  

This collection is meant to provide the key mapping between the sensor and the id. Only the id is recorded subsequently with the time series collection.

Any idea why this might be?

THanks

do...@slamdata.com

unread,
Jul 18, 2017, 5:41:43 PM7/18/17
to SlamData-User
Hi Nigel, unless you specifically select out the _id value when writing your query, you won't see it. This means going through an Open card you will not see the _id field in a Preview Table. If you want to see the _id value, you have to use a Query card with code similar to the following:

select
        `_id`
    ,   topic_name
from
        `/mount/db/topics`

That being said, the value is accessible to you in queries, even though we don't show it by default when running queries.

Hopefully this helps.

Nigel David

unread,
Jul 20, 2017, 5:37:59 PM7/20/17
to SlamData-User
Hi,

I ran the above query successfully using a query card, but when I follow that with a preview table card I still don't see the _id data.

do...@slamdata.com

unread,
Jul 20, 2017, 5:51:55 PM7/20/17
to SlamData-User
Sorry about that Nigel. I forgot we to alias the `_id` field to get it to show.

Change the query I provided as follows:

select
        `_id` as ID
    ,   topic_name
from
        `/mount/db/topics`

Nigel David

unread,
Jul 20, 2017, 6:06:27 PM7/20/17
to SlamData-User
Great. Thanks!
Reply all
Reply to author
Forward
0 new messages