{"record":{"id":"3add86e8f6a4bc04","repo":"pubkey/rxdb","slug":"you-are-using-a-function-which-must-be-overwritten-3add86","errorCode":null,"errorMessage":"You are using a function which must be overwritten by a plugin.\n        You should either prevent the usage of this function or add the plugin via:\n            import { ${pluginName} } from 'rxdb/plugins/${pluginKey}';\n            addRxPlugin(${pluginName});\n        ","messagePattern":"You are using a function which must be overwritten by a plugin\\.\n        You should either prevent the usage of this function or add the plugin via:\n            import (.+?) from 'rxdb/plugins/(.+?)';\n            addRxPlugin\\((.+?)\\);\n        ","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/rx-document.ts","lineNumber":284,"sourceCode":"            delete (data as any)._attachments;\n            delete (data as any)._deleted;\n            delete (data as any)._meta;\n            return overwritable.deepFreezeWhenDevMode(data);\n        } else {\n            return overwritable.deepFreezeWhenDevMode(this._data);\n        }\n    },\n    toMutableJSON(this: RxDocument, withMetaFields = false) {\n        return clone(this.toJSON(withMetaFields as any));\n    },\n\n    /**\n     * updates document\n     * @overwritten by plugin (optional)\n     * @param updateObj mongodb-like syntax\n     */\n    update(_updateObj: UpdateQuery<any>) {\n        throw pluginMissing('update');\n    },\n    incrementalUpdate(_updateObj: UpdateQuery<any>) {\n        throw pluginMissing('update');\n    },\n    updateCRDT(_updateObj: CRDTEntry<any> | CRDTEntry<any>[]) {\n        throw pluginMissing('crdt');\n    },\n    putAttachment() {\n        throw pluginMissing('attachments');\n    },\n    putAttachmentBase64() {\n        throw pluginMissing('attachments');\n    },\n    getAttachment() {\n        throw pluginMissing('attachments');\n    },\n    allAttachments() {\n        throw pluginMissing('attachments');","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/pubkey/rxdb/blob/af6fb65f94cd70558d74c23799eda11ff1c15224/src/rx-document.ts#L266-L302","documentation":"RxDocument.update() is a stub that is overwritten by an optional plugin. RxDB core ships only the placeholder; calling it without the matching plugin throws pluginMissing. The message tells you which plugin to import and register via addRxPlugin.","triggerScenarios":"Calling doc.update({ $set: { age: 5 } }) without importing 'rxdb/plugins/update'; using mongodb-like update operators without the update plugin; a setup where the plugin was removed during tree-shaking or refactor.","commonSituations":"Following docs examples that assume the update plugin is installed; forgetting to call addRxPlugin() after import; production build differing from dev because the plugin import was dropped.","solutions":["import { RxDBUpdatePlugin } from 'rxdb/plugins/update'; addRxPlugin(RxDBUpdatePlugin);","Alternatively use incrementalUpdate from 'rxdb/plugins/incremental-write' or a full-document put/patch","Check AGENTS/docs: the modern import path is rxdb/plugins/update"],"exampleFix":"// before\ndoc.update({ $set: { age: 5 } }); // pluginMissing\n// after\nimport { RxDBUpdatePlugin } from 'rxdb/plugins/update';\naddRxPlugin(RxDBUpdatePlugin);\ndoc.update({ $set: { age: 5 } });","handlingStrategy":"fallback","validationCode":"import { RxDBUpdatePlugin } from 'rxdb/plugins/update';\n// ensure once at startup:\nif (!overwritableMethodsUpdated()) { addRxPlugin(RxDBUpdatePlugin); }","typeGuard":null,"tryCatchPattern":"try {\n  await doc.update({ $set: { age: 5 } });\n} catch (err) {\n  if (String(err.message).includes('must be overwritten by a plugin')) {\n    return doc.incrementalPatch({ age: 5 }); // core fallback\n  }\n  throw err;\n}","preventionTips":["Register the update plugin in your central database-setup module","Prefer core incrementalPatch() when mongodb-style operators are not required","List all required plugins in one place with a comment per feature","Check rxdb.info docs page of each method for its plugin requirement"],"tags":["plugin-missing","update","setup"],"backgroundTag":"missing-plugin","analyzedSha":"af6fb65f94cd70558d74c23799eda11ff1c15224","analyzedAt":"2026-08-31T23:32:37.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}