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

Add Object.linkingObjectCount() #1792

Merged
merged 3 commits into from
May 16, 2018
Merged

Add Object.linkingObjectCount() #1792

merged 3 commits into from
May 16, 2018

Conversation

astigsen
Copy link
Contributor

What, How & Why?

This adds Object.linkingObjectCount() method to get the total number of incoming links to an object.

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 🚦 Tests
  • 📝 Public documentation PR created or is not necessary
  • 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • typescript definitions file is updated
  • jsdoc files updated
  • Chrome debug API is updated if API is available on React Native

Copy link
Member

@nirinchev nirinchev left a 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 :)

@astigsen
Copy link
Contributor Author

I also thought of naming it backlinksCount(), but in the end I found it more correct to align the naming with the other method on the object which is called linkingObjects() (in .NET this looks to be named GetBacklinks(), so there it would match up).

Copy link
Contributor

@kneth kneth left a 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) {}
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

@kneth
Copy link
Contributor

kneth commented May 15, 2018

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).

@kneth kneth merged commit 48b9390 into master May 16, 2018
@kneth kneth deleted the as-linkingobjectcount branch May 16, 2018 08:55
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 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 this pull request may close these issues.

4 participants