async function createDatabase() {
addRxPlugin(RxDBReplicationCouchDBPlugin);
addPouchPlugin(PouchdbAdapterIdb);
addRxPlugin(RxDBLeaderElectionPlugin);
const database = await createRxDatabase({
name: 'dictionaries',
storage: getRxStoragePouch('idb')
});
await database.addCollections({
dictionaries: {
schema: {
title: 'dictionary',
description: '',
version: 0,
primaryKey: 'id',
type: 'object',
keyCompression: false,
properties: {
id: {
type: 'string',
maxLength: 100,
},
name: {
type: 'string',
minLength: 1,
maxLength: 30,
},
},
required: ['id', 'name']
}
}
})
}
When I pass some value as an id, it is used as part of an auto-generated key:
const db = await createDatabase();
await db.dictionaries.newDocument({
id: 'bar',
name: 'English'
}).save(); // _doc_id_rev inside the db would be of format "bar::<auto-generated value>"
My question is is there any way to say RxDB that generating id's values for dictionaries is of its own concern or my single option is always to provide a dummy value, such as bar?