rx-schema-helper.ts:104 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'key')
at getPrimaryFieldOfPrimaryKey (rx-schema-helper.ts:104:63)
at fillWithDefaultSettings (rx-schema-helper.ts:163:33)
at createRxSchema (rx-schema.ts:153:25)
at rx-database.ts:280:28
at Array.forEach (<anonymous>)
at RxDatabaseBase2.addCollections (rx-database.ts:276:44)
at index.ts:24:20
at Array.map (<anonymous>)
at creatDataBase (index.ts:22:29)
rxSchema: enter image description here
why?
use rxdb to undate the data into indexeddb when i change the local data. or change the properties.
myDatabase.addCollections({ schema, });
this ok. but when i use the plugin 'RxDBMigrationPlugin',myDatabase.addCollections({messages: {schema,migrationStrategies: {2: function (oldDoc: any) {oldDoc.time = new Date(oldDoc.time).getTime(); return oldDoc;},}},})
. it happend