cursor = db.flow.aggregate([
    {
        $match : {
            timeFirst : { $gte : time_from },
            timeLast  : { $lte : time_to },
        }
    },
    {
        $unwind : "$vlanID"
    },
    {
        $group : {
            _id : null,
            distinct_vlans : { $addToSet : "$vlanID" },
        }
    },
    {
        $unwind : "$distinct_vlans"
    }
])

cursor.forEach(
    function(e) {
        print(e.distinct_vlans)
    }
)
