Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-3036

Unresponsive "Documents" view for data with big arrays

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.17.0
    • 1.15.0
    • Compass
    • None
    • Iteration Naan, Iteration Octopus, Iteration Paneer, Iteration Qbert, Iteration Ratatouille, Iteration Sriracha

    Description

      When trying to view the data on a collection which has documents with big arrays in it, the compass UI gets completely unresponsive. The same problem is encountered in Aggregations tab as well.

      The problem is common for most of IoT projects, it's not unusual to see such documents there. 

      Below the script to simulate the issue:

      const DATA_SIZE  = 60 * 60 * 12 // every second for 12 hours
      const adjectives = 'autumn hidden smiling bitter misty'.split(' ')
      const nouns      = 'waterfall river carefully breeze moon rain'.split(' ')
       
      const getRandomNumber = limit => (Math.random() * limit).toFixed(4) * 1
       
      function insertData(left, right, coll) {
          print(`inserting: ${left}-${right} `)
          coll.insert({
              serverName : `${left}-${right}`,
              hostName   : `${left}${right}.local`,
              eventName  : right,
              data       : generateRandomData(DATA_SIZE)
          })
      }
       
      function generateRandomData(size) {
          var temp = []
          for(let i = 0; i < size; i++ ) {
              temp.push({
                  ts : new Date().getTime() + i,
                  v  : i + getRandomNumber(1000)
              })
          }
          return temp
      }
       
      function populateCollection(coll) {
          coll.drop()
          coll.createIndex({serverName: 1, eventName: 1})
          adjectives.forEach(adj => nouns.forEach(noun => insertData(adj, noun, coll)))
      }
       
      populateCollection(db.iot)
       
      print('Enjoy!')
      
      

       

      Attachments

        Activity

          People

            durran.jordan@mongodb.com Durran Jordan
            vladimir.banishevski@mongodb.com Vlad Banishevskii
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: