-
Notifications
You must be signed in to change notification settings - Fork 577
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
Add Object.linkingObjectCount() #1792
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In .NET this is called BacklinksCount
: https://github.com/realm/realm-dotnet/blob/master/Realm/Realm/RealmObject.cs#L108. Not sure what's the name in other SDKs but we should probably align :)
I also thought of naming it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 expect minor comment.
docs/object.js
Outdated
* @returns {number} number of links to this object. | ||
* @since 2.6.0 | ||
*/ | ||
linkingObjectsCount(objectType, property) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter should be documented too. They can be copied from the method above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the C++ implementation this method shouldn't take any parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should not take any parameters. It was a copy/paste mistake. Fixed.
One - unrelated - test is failing in one build. I have seen it before, and I haven't a clear understanding of why it fails. I believe we can ignore it for now (see also #1748). |
What, How & Why?
This adds
Object.linkingObjectCount()
method to get the total number of incoming links to an object.☑️ ToDos
Compatibility
label is updated or copied from previous entryBreaking
label has been applied or is not necessaryIf this PR adds or changes public API's: