Custom id generation for Redis-OM nodejs using provided entity data

Viewed 16

for example:

const fooSchema = new Schema(Foo, {
    userId: { type: 'number' },
    channelId: { type: 'number' }
}, {
    idStrategy: () => `${userId}${channelId}`
});

Is it possible to provide the idStrategy function with the entity data?

0 Answers
Related