{"record":{"id":"f2628cafafc3aef1","repo":"Automattic/mongoose","slug":"invalid-bson-type-for-fle-field-path","errorCode":null,"errorMessage":"Invalid BSON type for FLE field: '${path}'","messagePattern":"Invalid BSON type for FLE field: '(.+?)'","errorType":"exception","errorClass":"MongooseError","httpStatus":null,"severity":"error","filePath":"lib/schema.js","lineNumber":955,"sourceCode":"  }\n\n  const aliasObj = Object.fromEntries(\n    Object.entries(obj).map(([key]) => ([prefix + key, null]))\n  );\n  aliasFields(this, aliasObj);\n  return this;\n};\n\n/**\n * @param {string} path\n * @param {object} fieldConfig\n *\n * @api private\n */\nSchema.prototype._addEncryptedField = function _addEncryptedField(path, fieldConfig) {\n  const type = this.path(path).autoEncryptionType();\n  if (type == null) {\n    throw new MongooseError(`Invalid BSON type for FLE field: '${path}'`);\n  }\n\n  this.encryptedFields[path] = clone(fieldConfig);\n};\n\n/**\n * @param {string} path\n *\n * @api private\n */\nSchema.prototype._removeEncryptedField = function _removeEncryptedField(path) {\n  delete this.encryptedFields[path];\n};\n\n/**\n * @api private\n *\n * @returns {boolean}","sourceCodeStart":937,"sourceCodeEnd":973,"githubUrl":"https://github.com/Automattic/mongoose/blob/49cdab01366679723b487ecb754b38570f783289/lib/schema.js#L937-L973","documentation":"Error \"Invalid BSON type for FLE field: '${path}'\" thrown in Automattic/mongoose.","triggerScenarios":"Thrown at lib/schema.js:955 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49cdab01366679723b487ecb754b38570f783289","analyzedAt":"2026-08-21T22:54:00.882Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}