vicpinm / Kotlin-Realm-Extensions

Kotlin extensions to simplify Realm API.
Apache License 2.0
535 stars 53 forks source link

Add a function 'update' #21

Closed qiantao94 closed 7 years ago

qiantao94 commented 7 years ago

Use this function, we can find a first entry by the specified query, then modify and update it.

qiantao94 commented 7 years ago

For example:

User().update(query = { query -> query.equalTo("id", 1) },
                modify = { user -> user.name = "update" })
vicpinm commented 7 years ago

Thanks for your PR! In a few days, I will merge it into master.

vicpinm commented 7 years ago

Hi @bestTao , I have merged your PR into master. You can now find a new method called queryAndUpdate() in version 1.2.0