Mongodb multi-table connections by Json

Need mongodb for multi-table connections. Redash will support the $lookup operation.

Redash supports the $lookup aggregation. Suppose you have two collections called movies and comments, you could join the collections like this:

{
    "collection": "movies",
    "aggregate": [
        {"$lookup": {
            "from": "comments",
            "localField": "_id",
            "foreignField": "movie_id",
            "as": "myJoin"
        }},
        {"$limit": 10}
        ]
}

The usual caveats apply: if your data isn’t normalized you may need to include an $unwind in your pipeline. Also, be careful about projecting large relationships without a $limit aggregation. When I wrote this example I accidentally tried to pull 100 comments per movie (and there are 50k movies in my sample collection). The browser wasn’t happy with me ;-).