code: def _projection_to_paths(cls, root_key, projection):
          
  
          # Referenced projections are handled separately so just flag the
          # reference field to true.
          if '$ref' in projection:
              return True
  
          inclusive = True
          sub_projection = {}
          for key, value in projection.items():
              if key in ['$sub', '$sub.']:
                  continue
  
              if key.startswith('$'):
                  sub_projection[root_key] = {key: value}
                  inclusive = False
                  continue
  
              sub_key = root_key + '.' + key
  
              if isinstance(value, dict):
                  sub_value = cls._projection_to_paths(sub_key, value)
                  if isinstance(sub_value, dict):
                      sub_projection.update(sub_value)
                  else:
                      sub_projection[sub_key] = True
  
              else:
                  sub_projection[sub_key] = True
                  inclusive = False
  
          if inclusive:
              # No specific keys so this is inclusive
              return True
  
          return sub_projection
docs: Expand a $sub/$sub. projection to a single projection of True (if
          inclusive) or a map of full paths (e.g `employee.company.tel`).