Open louis-vinchon opened 2 years ago
this is a good idea. we should implement it.
would you be interested in submitting a PR?
This is needed. I have set my 'mode' on the schema creation to 'relaxed' and everywhere else I use MUUID
const mUUID = MUUID.mode('relaxed');
and in the schema:
_id: { type: 'object', value: { type: 'Buffer' }, default: () => mUUID.v4() },
except when stringified, the documents return the 'canonical' version of the string. I am unable to convert this canonical version to a uuid usingMUUID.from("DEol4JenEeqVKusA+dzMMA==")
meaning I can't query the db...
@cdimascio does relaxed work with v4? What am I doing wrong here?
I'm looking for the same solution, how to parse the canonical version hJVV+w11SZqk+vK9BSCpeA==
or convert it to "relaxed" version?
The library has several formating options, which is nice, however it only understands one of them when you "parse" a string with the
from()
method, which is weird.Steps to reproduce:
An optional parsing parameter like we have in the
toString
method would make a lot of sense, e.g.MUUID.from(string, 'N');