Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MongoDB ObjectId field type #652

Closed
rorbech opened this issue Jan 25, 2022 · 2 comments · Fixed by #798
Closed

Support MongoDB ObjectId field type #652

rorbech opened this issue Jan 25, 2022 · 2 comments · Fixed by #798
Assignees

Comments

@rorbech
Copy link
Contributor

rorbech commented Jan 25, 2022

We should support the MongoDB ObjectId field type: https://docs.mongodb.com/manual/reference/method/ObjectId/

@sdeff
Copy link

sdeff commented Mar 17, 2022

Any updates about when we can expect support for ObjectId?

Or is there a workaround which allows using a RealmObject with ObjectId as primary key within a Kotlin Multiplatform app?

@sync-by-unito sync-by-unito bot assigned nhachicha and unassigned nhachicha Apr 7, 2022
@tylergannon
Copy link

@sdeff what about defining your own value class ObjectId(val id: ByteArray), then the database column will contain compatible data for when the feature is released? It's hacky but might get you going?

you can expect the constructors and implement them by delegating to the org.bson.types.ObjectId implementation.

expect fun ObjectId(): ObjectId
expect fun ObjectId(hexValue: String): ObjectId

Untested so ymmv. I'd be curious if someone more knowledgable than this relative noob could say a priori that it won't work.

@nhachicha nhachicha self-assigned this Apr 20, 2022
@nhachicha nhachicha linked a pull request Apr 21, 2022 that will close this issue
4 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants