When defining stores in Version.stores(), you can use the $$ (double dollar) prefix for a primary key. This tells Dexie.Observable to automatically generate a UUID string for that key.
Customizing UUID Generation
Dexie adds a static method Dexie.createUUID() which is used internally for the $$ prefix. You can override this method to change the UUID format:
Dexie.createUUID = function() {
// Return your custom UUID format
return 'custom-uuid-' + Date.now();
};
db.version(1).stores({
friends: "$$uuid,name"
});