Closed osvaldokalvaitir closed 3 years ago
did you ever figure out how to do this?
@KrisLau
dataCollection.create(data => {
data._raw.id = uuidv1();
data.name = 'test';
});
});
Thanks!
@osvaldokalvaitir I just found a better way to do this! There was apparently a method created called setGenerator
and if you call it from the index file you can set all the tables to default to uuid.
setGenerator(() => uuidv4());
@osvaldokalvaitir I just found a better way to do this! There was apparently a method created called
setGenerator
and if you call it from the index file you can set all the tables to default to uuid.
setGenerator(() => uuidv4());
That's exactly it, for everyone. And sometimes a custom generator is required only for some tables
the id generated by watermelondb looks like 'wypnlx2gbjho3aw4'.
is it possible to change the format of id generation to uuid?
'8e82e350-6e00-11eb-b274-b7302cbbb5f5'
to follow the pattern of my backend!