LittleDemon WebShell


Linux premium331.web-hosting.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64
Path : /home/livedhms/lmgt/node_modules/mongoose/lib/helpers/indexes/
File Upload :
Command :
Current File : /home/livedhms/lmgt/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js

'use strict';

const get = require('../get');

module.exports = function isDefaultIdIndex(index) {
  if (Array.isArray(index)) {
    // Mongoose syntax
    const keys = Object.keys(index[0]);
    return keys.length === 1 && keys[0] === '_id' && index[0]._id !== 'hashed';
  }

  if (typeof index !== 'object') {
    return false;
  }

  const key = get(index, 'key', {});
  return Object.keys(key).length === 1 && Object.hasOwn(key, '_id');
};

LittleDemon - FACEBOOK
[ KELUAR ]