realm-js
realm-js copied to clipboard
Upgrade to BSON v5
Currently, upgrading bson to v5 causes the integration tests to fail in react-native. It's probably due to some polyfills needing to be implemented. We should investigate what is needed to be done here in order to stay up to date with the current updates to the bson package.
Sorry if I do not open a new issue, but mine is a little bit related.
I have a RN project where I had an issue with the realm / BSON import statements (like this one import { UUID } from 'bson';).
Since I am using BSON only for UUID, can I use any other library to define the UUID fields in my schema as I read on BSON's Jira that RN is not clearly supported ?
Because right now, I had to downgrade to v4.x and then also downgrade Realm to v10.x.
@LiohAu You can import BSON directly out of realm, as we re-export it.
import { BSON } from 'realm';
const id = new BSON.UUID();
Currently you we only store BSON types, but you can use another library and transform it to a string, if that's desired. You shouldn't have to downgrade Realm in order to use v4.x.
Closing this issue in favour of https://github.com/realm/realm-js/issues/6561