function isPopulatedObject(obj) {
  if (obj == null) {
    return false;
  }

  return Array.isArray(obj) ||
    obj.$isMongooseMap ||
    obj.$__ != null ||
    leanPopulateMap.has(obj);
}
Determine if `obj` is something we can set a populated path to. Can be a
document, a lean document, or an array/map that contains docs.
@param {Any} obj
@api private