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

Delete object #45

Open
saecmca opened this issue Mar 1, 2019 · 2 comments
Open

Delete object #45

saecmca opened this issue Mar 1, 2019 · 2 comments

Comments

@saecmca
Copy link

saecmca commented Mar 1, 2019

How to delete the object class values.
I use this in putobject.
fun putObject(key: String, value: Any, context: Context) {
TinyDB(context).putObject(key, value)
}

but I need to delete also the object.

@kcochibili
Copy link
Owner

you can do that using the remove() function, Like this:
tinydb.remove(myObjectKey);

@saecmca
Copy link
Author

saecmca commented Mar 5, 2019

I can't delete the model class object.

val tinyDB=TinyDB(activity)
val statelists = AppConstants.getObject(AppConstants.KEY_OTHERCATEGORY,
activity!!, OtheCatResp::class.java as Class) as? OtheCatResp
if(statelists!=null) {
Log.w("before size", "" + statelists!!.DATA.size)
tinyDB.remove(AppConstants.KEY_OTHERCATEGORY)
Log.w("after size", "" + statelists!!.DATA.size)
}

but my output
W/before size: 100
W/after size: 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants