{"record":{"id":"b3abeb087f576055","repo":"pubkey/rxdb","slug":"doc1","errorCode":"DOC1","errorMessage":"RxDB Error-Code: DOC1. 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: DOC1\\. 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":139,"sourceCode":"        );\n    },\n    get $$(): any {\n        const _this: RxDocument = this as any;\n        const reactivity = _this.collection.database.getReactivityFactory();\n        return reactivity.fromObservable(\n            _this.$,\n            _this.getLatest()._data,\n            _this.collection.database\n        );\n    },\n\n    /**\n     * returns observable of the value of the given path\n     */\n    get$(this: RxDocument, path: string): Observable<any> {\n        if (overwritable.isDevMode()) {\n            if (path.includes('.item.')) {\n                throw newRxError('DOC1', {\n                    path\n                });\n            }\n\n            if (path === this.primaryPath) {\n                throw newRxError('DOC2');\n            }\n\n            // final fields cannot be modified and so also not observed\n            if (this.collection.schema.finalFields.includes(path)) {\n                throw newRxError('DOC3', {\n                    path\n                });\n            }\n\n            const schemaObj = getSchemaByObjectPath(\n                this.collection.schema.jsonSchema,\n                path","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/pubkey/rxdb/blob/af6fb65f94cd70558d74c23799eda11ff1c15224/src/rx-document.ts#L121-L157","documentation":"DOC1 is thrown by RxDocument.get$(path) (and .get()) when the observed path contains '.item.'. RxDB does not support observing array items via this placeholder syntax; array fields must be observed as a whole and iterated in code. This check only runs when the dev-mode plugin is enabled.","triggerScenarios":"Calling doc.get$('tags.item.0') or similar paths containing '.item.' while the dev-mode plugin is active; also commonly via doc.getField().$ or reactive property access built from a path string containing '.item.'.","commonSituations":"Porting code from RxDB versions or other databases that supported per-item array observation; dynamically constructing observable paths from UI config that includes '.item.'; misunderstanding docs on nested array observation.","solutions":["Observe the whole array field instead: doc.get$('tags') then map/filter in the subscription.","For a specific element, compute it from the array value: doc.get$('tags').pipe(map(arr => arr[0])).","Remove '.item.' from any dynamically generated paths."],"exampleFix":"// before\ndoc.get$('tags.item.0').subscribe(v => ...);\n// after\nimport { map } from 'rxjs';\ndoc.get$('tags').pipe(map(tags => tags[0])).subscribe(v => ...);","handlingStrategy":"validation","validationCode":"function assertObservablePath(path, doc) {\n  if (typeof path === 'string' && path.includes('.item.')) {\n    throw new Error('Cannot observe array item path: ' + path);\n  }\n}","typeGuard":"function isObservablePath(path) {\n  return typeof path === 'string' && !path.includes('.item.');\n}","tryCatchPattern":"try {\n  obs = doc.get$(path);\n} catch (err) {\n  if (String(err?.code) === 'DOC1') {\n    // fall back to observing the parent array field\n    obs = doc.get$(path.split('.item.')[0]);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Never build paths containing '.item.'; observe the array field and map in RxJS.","Sanitize dynamically generated field paths before calling get$.","Run with the dev-mode plugin in development so these mistakes surface immediately.","Check the schema: arrays are observed as a whole, not per item."],"tags":["rxdocument","observable","array","dev-mode"],"backgroundTag":"unsupported-observable-path","analyzedSha":"af6fb65f94cd70558d74c23799eda11ff1c15224","analyzedAt":"2026-08-31T23:32:37.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}