-
Notifications
You must be signed in to change notification settings - Fork 299
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
Support observing changes to single properties #1027
Comments
Are you suggesting partial objects? Then please vote for #348 |
@greenrobot-team 如果用findLazy 那么久不能用监听 我是想在监听的时候避免内存开销 Translation: If I use findLazy, I can’t use monitoring for a long time. I want to avoid memory overhead when I’m monitoring. |
If I understand correctly, you can do this using But you can also build your own solution using query offset and limit plus a query observer that re-runs the query. Edit: here is the implementation of |
RxQuery 的返回值 只需要一个信号 而不是指定条件全量的数据(指定条件的全量数据并不是我想要的,极大),我需要按照这个信号 重新递归查询,不能直接获取这些数据来给业务
Translated: The return value of RxQuery only needs a signal instead of the full amount of data for the specified condition (the full amount of data for the specified condition is not what I want, it is very large), I need to re-recursive query according to this signal, I cannot directly obtain the data to give to the business |
每个模型数据极大 字段极多,我希望按照某种条件去观察他们 提供返回值只有一个bool值 而不是全量数据, 那么我通过这个bool值 Translation: The data of each model is very large and there are many fields. I want to observe them according to certain conditions. Provide the return value with only one bool value instead of full data, then I pass this bool value Then go to another place to get the desired data (for example, the tree is deeply recursively queried). If the observation returns the data corresponding to the observation, the amount of data is not necessarily what I want, and it also causes lag. |
Then maybe just subscribe to changes in a Box (this is what the query subscription does internally). E.g. boxStore.subscribe(Note::class.java).observer {
// Data in Note box has changed.
} https://docs.objectbox.io/data-observers-and-rx#observing-general-changes |
这个粒度又太大了 ,很多没必要的刷新都要产生 Translation: This granularity is too large, and many unnecessary refreshes will be generated. |
Alright, renamed the title and keeping this as a feature request then. For anyone interested, please thumbs up the first post! Note these related feature requests: |
您好,能否快速支持一下呢?我现在app 卡在性能优化这块,十分感谢 |
+1,Good idea |
+1, I also need this feature |
如果监听的时候可以设置limit offset 也可以 If you can set limit offset when listening, you can also set it 如果监听的时候可以设置limit offset 也可以 If you can set limit offset when listening, you can also set it |
我发现特别有意思的东西 这个监听并不是真正意义上的监听 I found something very interesting. This monitoring is not really monitoring For example, if my listening condition is age < 20, the listening before I insert the data with age = 21 still receives, but it is queried again according to the original query condition |
Translation:
I hope to support custom models to query. For example, the storage model is A. I want to use B to accept only some fields of the same name of A to ensure memory overhead. For example, when I do tabular data, I want to query some fields of model A (due to model A There are more than 20 fields) I only want to monitor some of the fields in this model. The current monitoring is full, which will result in a complete model of 20,000 data observations and 200,000 data. For example, I only want to monitor changes and get this Twenty thousand ids, then 20,000 complete model objects will not be generated. This function room provides
Original issue:
希望支持自定义模型来查询 比如存储模型是A 我希望用B 来接受 B只有A的一些同名字段 来保证内存开销
希望支持自定义模型来查询 比如存储模型是A 我希望用B 来接受 B只有A的一些同名字段 来保证内存开销
比如我在做表格数据的时候 希望查询出模型A的部分字段(由于模型A的字段已经超过20个) 我只想监听 这个模型中的部分字段
目前的监听 是全量的 会导致有2万条数据 观察返回也返回了20万条数据的完整模型 比如我只想监听改变而得到这两万个id,那么不会产生2万个完整的模型对象 这个功能room有提供
The text was updated successfully, but these errors were encountered: