function _getPopulatedPaths(list, arr, prefix) {
  for (const pop of arr) {
    list.push(prefix + pop.path);
    if (!Array.isArray(pop.populate)) {
      continue;
    }
    _getPopulatedPaths(list, pop.populate, prefix + pop.path + '.');
  }
}
Gets a list of paths to be populated by this query

#### Example:

     bookSchema.pre('findOne', function() {
       let keys = this.getPopulatedPaths(); // ['author']
     });
     ...
     Book.findOne({}).populate('author');

#### Example:

     // Deep populate
     const q = L1.find().populate({
       path: 'level2',
       populate: { path: 'level3' }
     });
     q.getPopulatedPaths(); // ['level2', 'level2.level3']

@return {Array} an array of strings representing populated paths
@api public