{"record":{"id":"1491c1f45e7663fb","repo":"pubkey/rxdb","slug":"you-are-using-a-function-which-must-be-overwritten-1491c1","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-query.ts","lineNumber":559,"sourceCode":"            this.asRxQuery,\n            (doc) => doc.incrementalRemove(),\n        );\n    }\n\n\n    /**\n     * helper function to transform RxQueryBase to RxQuery type\n     */\n    get asRxQuery(): RxQuery<RxDocType, RxQueryResult, OrmMethods, Reactivity> {\n        return this as any;\n    }\n\n    /**\n     * updates all found documents\n     * @overwritten by plugin (optional)\n     */\n    update(_updateObj: any): Promise<RxQueryResult> {\n        throw pluginMissing('update');\n    }\n\n    patch(patch: Partial<RxDocType>): Promise<RxQueryResult> {\n        return runQueryUpdateFunction(\n            this.asRxQuery,\n            (doc) => doc.patch(patch),\n        );\n    }\n    incrementalPatch(patch: Partial<RxDocType>): Promise<RxQueryResult> {\n        return runQueryUpdateFunction(\n            this.asRxQuery,\n            (doc) => doc.incrementalPatch(patch),\n        );\n    }\n    modify(mutationFunction: ModifyFunction<RxDocType>): Promise<RxQueryResult> {\n        return runQueryUpdateFunction(\n            this.asRxQuery,\n            (doc) => doc.modify(mutationFunction),","sourceCodeStart":541,"sourceCodeEnd":577,"githubUrl":"https://github.com/pubkey/rxdb/blob/af6fb65f94cd70558d74c23799eda11ff1c15224/src/rx-query.ts#L541-L577","documentation":"RxQuery.update() is a stub that must be overwritten by a plugin (query-builder's update plugin / rxdb/plugins/update). Calling it without that plugin registered throws the pluginMissing error, telling you which import adds it.","triggerScenarios":"Calling myQuery.update({ $set: ... }) without importing and registering the update plugin via addRxPlugin(); production builds where dev-mode was removed along with plugin registration.","commonSituations":"Copying examples from the docs (which assume plugins) into a slim build; tree-shaken bundles that dropped the addRxPlugin call; upgrading RxDB where query update moved behind an optional plugin.","solutions":["Run `npm install rxdb/plugins/update` usage: import { updatePlugin } from 'rxdb/plugins/update'; addRxPlugin(updatePlugin); before any query.update() call.","Alternatively use RxDocument-level incrementalModify/incrementalPatch per document instead of query.update().","Register plugins once at app startup so all query.update() call sites work."],"exampleFix":"// before\nconst result = await collection.find({ age: { $lt: 18 } }).update({ $set: { minor: true } });\n// after\nimport { addRxPlugin } from 'rxdb';\nimport { updatePlugin } from 'rxdb/plugins/update';\naddRxPlugin(updatePlugin);\nconst result = await collection.find({ age: { $lt: 18 } }).update({ $set: { minor: true } });","handlingStrategy":"try-catch","validationCode":"import { getRxStorageDexie } from 'rxdb/plugins/dexie';\nimport { RXDB_VERSION } from 'rxdb';\nif (!getPluginUpdateRegistered()) { addRxPlugin(updatePlugin); } // check your own registry before calling query.update()","typeGuard":"null","tryCatchPattern":"try {\n  await query.update({ $set: { done: true } });\n} catch (err) {\n  if (typeof err?.message === 'string' && err.message.includes('plugin')) {\n    addRxPlugin(updatePlugin);\n  } else { throw err; }\n}","preventionTips":["Register all optional plugins (update, query-builder, dev-mode) in one startup module.","Keep addRxPlugin calls as side-effect imports so tree-shaking cannot remove them.","Test production builds, where dev-mode no longer masks missing plugins."],"tags":["plugin-missing","update","rxquery"],"backgroundTag":"missing-plugin","analyzedSha":"af6fb65f94cd70558d74c23799eda11ff1c15224","analyzedAt":"2026-08-31T23:32:37.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}