Update docs and CHANGELOG with objectForPrimaryKey

This commit is contained in:
Scott Kyle 2016-06-03 16:59:50 -07:00
parent cd0bb079b7
commit 3c657c3bbf
2 changed files with 11 additions and 0 deletions

View File

@ -5,6 +5,7 @@ x.x.x Release notes (yyyy-MM-dd)
### Enhancements
* Added `isValid()` method to `List` and `Results` to check for deleleted or invalidated objects
* Added `objectForPrimaryKey(type, key)` method to `Realm`
### Bugfixes
* None

View File

@ -106,6 +106,16 @@ class Realm {
*/
objects(type) {}
/**
* Searches for a Realm object by its primary key.
* @param {Realm~ObjectType} type - The type of Realm object to search for.
* @param {number|string} key - The primary key value of the object to search for.
* @throws {Error} If type passed into this method is invalid or if the object type did
* not have a `primaryKey` specified in its {@link Realm~ObjectSchema ObjectSchema}.
* @returns {Realm.Object|undefined} if no object is found.
*/
objectForPrimaryKey(type, key) {}
/**
* Add a listener `callback` for the specified event `name`.
* @param {string} name - The name of event that should cause the callback to be called.