We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Always
I'm reading objects from my realm, I want to sort the results using the sorted(by:ascending:) method by the ObjectId. However, I get the warning:
sorted(by:ascending:)
ObjectId
Instance method 'sorted(by:ascending:)' requires that 'ObjectId.PersistedType' (aka 'ObjectId') conform to 'SortableType'
The documentation mentions, that sorting by ObjectId will usually result in sorting by creation date, so I assume it should be possible.
Example code in my project:
try await realm? .objects(UserToken.self) .sorted(by: \._id, ascending: true) .subscribe(name: #function)
No response
10.52.1
Atlas Device Sync
No
iOS 18.0.x
Xcode version: 16.0 beta 2 (16A5171r) Dependency manager and version: SwiftPM - swift-tools-version: 5.10
The text was updated successfully, but these errors were encountered:
➤ PM Bot commented:
Jira ticket: RCOCOA-2406
Sorry, something went wrong.
Easy fix.
Just change
.sorted(by: \._id, ascending: true)
to
.sorted(by: \._id.stringValue, ascending: true)
That's great! Thank you!
No branches or pull requests
How frequently does the bug occur?
Always
Description
I'm reading objects from my realm, I want to sort the results using the
sorted(by:ascending:)
method by theObjectId
. However, I get the warning:The documentation mentions, that sorting by
ObjectId
will usually result in sorting by creation date, so I assume it should be possible.Example code in my project:
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
No response
Version
10.52.1
What Atlas Services are you using?
Atlas Device Sync
Are you using encryption?
No
Platform OS and version(s)
iOS 18.0.x
Build environment
Xcode version: 16.0 beta 2 (16A5171r)
Dependency manager and version: SwiftPM - swift-tools-version: 5.10
The text was updated successfully, but these errors were encountered: