Skip to content

feat: add bson ObjectId impl#340

Merged
gustavo-shigueo merged 7 commits intoAleph-Alpha:mainfrom
ShaunSHamilton:feat_bson-objectid
Jul 24, 2024
Merged

feat: add bson ObjectId impl#340
gustavo-shigueo merged 7 commits intoAleph-Alpha:mainfrom
ShaunSHamilton:feat_bson-objectid

Conversation

@ShaunSHamilton
Copy link
Copy Markdown
Contributor

Goal

The docs suggest the bson-uuid-impl feature flag implements types from bson. However, this is misleading, because it just implements TS for bson::Uuid.

On top of this, the library suggests there is a bson feature flag. However, enabling this does nothing. So, this pr adds an impl for bson::oid::ObjectId which is a particularly common type.

This PR does not expect to implement every exported type from bson. Hopefully, this will be done in future releases of ts-rs.

Related to #186

Changes

  • Added bson::oid::ObjectId impl under bson feature config.
  • Changed lib docs about bson feature flag

Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

Notes

The docs suggest running cargo +nightly fmt. However, after running this, unrelated files were changed. So, those have not been pushed.

bson serializes ObjectId into { "$oid": <string> }. However, this is likely not what users want in their types.

Comment thread README.md Outdated
@gustavo-shigueo gustavo-shigueo merged commit e268437 into Aleph-Alpha:main Jul 24, 2024
@ShaunSHamilton ShaunSHamilton deleted the feat_bson-objectid branch July 24, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants