{"record":{"id":"69d2d569a3a50529","repo":"pubkey/rxdb","slug":"doc14","errorCode":"DOC14","errorMessage":"RxDB Error-Code: DOC14. Hint: Error messages are not included in RxDB core to reduce build size. To show the full error messages and to ensure that you do not make any mistakes when using RxDB, use the dev-mode plugin when you are in development mode: https://rxdb.info/dev-mode.html?console=error","messagePattern":"RxDB Error-Code: DOC14\\. Hint: Error messages are not included in RxDB core to reduce build size\\. To show the full error messages and to ensure that you do not make any mistakes when using RxDB, use the dev-mode plugin when you are in development mode: https://rxdb\\.info/dev-mode\\.html\\?console=error","errorType":"error_code","errorClass":"RxError","httpStatus":null,"severity":"error","filePath":"src/rx-document.ts","lineNumber":442,"sourceCode":"                this.primary,\n                this._data,\n                error\n            );\n        }\n        return removeResult.success[0];\n    },\n    incrementalRemove(this: RxDocument): Promise<RxDocument> {\n        return this.incrementalModify(async (docData) => {\n            await this.collection._runHooks('pre', 'remove', docData, this);\n            docData._deleted = true;\n            return docData;\n        }).then(async (newDoc) => {\n            await this.collection._runHooks('post', 'remove', newDoc._data, newDoc);\n            return newDoc;\n        });\n    },\n    close() {\n        throw newRxError('DOC14');\n    }\n};\n\nexport function createRxDocumentConstructor(proto = basePrototype) {\n    const constructor = function RxDocumentConstructor(\n        this: RxDocument,\n        collection: RxCollection,\n        docData: RxDocumentData<any>\n    ) {\n        this.collection = collection;\n\n        // assume that this is always equal to the doc-data in the database\n        this._data = docData;\n\n        /**\n         * @performance\n         * Lazy-initialize _propertyCache only when first needed\n         * instead of creating a new Map for every RxDocument,","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/pubkey/rxdb/blob/af6fb65f94cd70558d74c23799eda11ff1c15224/src/rx-document.ts#L424-L460","documentation":"DOC14 is thrown by the base RxDocument prototype close() method, which is another stub that must be overwritten by a plugin. There is no per-document close in RxDB core, so calling close() on a document instance always throws unless a plugin implements it.","triggerScenarios":"Calling doc.close() on an RxDocument instance, likely by confusing the document API with the database or collection API, or following code written for a different database wrapper.","commonSituations":"Copy-pasted cleanup code where rxDatabase.close() was intended; generic resource-cleanup helpers that call close() on every handle including documents.","solutions":["Remove the doc.close() call; RxDocuments have no close method and need no explicit cleanup.","If you meant to close the database, call rxDatabase.close() instead.","If you meant to delete the document, use await doc.remove() instead."],"exampleFix":"// before\nawait doc.close();\n\n// after\nawait doc.remove(); // delete the document\n// or: await db.close(); // close the whole database","handlingStrategy":"type-guard","validationCode":"if (typeof (doc as any).close === 'function' && doc.collection) {\n  throw new Error('RxDocument has no close(); use db.close() or doc.remove()');\n}","typeGuard":"function isDatabaseLike(obj: unknown): obj is { close(): Promise<void> } {\n  return typeof obj === 'object' && obj !== null && 'collections' in obj && 'close' in obj;\n}","tryCatchPattern":"try {\n  await resource.close();\n} catch (err) {\n  if (err?.code === 'DOC14') {\n    console.warn('called close() on an RxDocument; no-op');\n  } else {\n    throw err;\n  }\n}","preventionTips":["Only call close() on RxDatabase instances; type cleanup helpers narrowly instead of any handle with close().","Use doc.remove() for document deletion and db.close() for shutdown.","Enable the dev-mode plugin in development so stub-method misuse is explained."],"tags":["api-misuse","stub-method","lifecycle"],"backgroundTag":"missing-plugin","analyzedSha":"af6fb65f94cd70558d74c23799eda11ff1c15224","analyzedAt":"2026-08-31T23:32:37.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}