A
A
Alexey2020-08-19 15:36:35
Angular
Alexey, 2020-08-19 15:36:35

How to make changes inside nested arrays/objects in RxDB?

Good afternoon.
RxDB has created a schema that contains an array of arrays of objects, for example Chat [ Room [{message}, {message}, {message}], Room [{message}, {message}, {message} ], Room [{message }, {message}, {message}]].
Each message contains the fields roomId, msg, attachment.
Based on this schema, a database was created in the application.
How to make changes inside arrays with messages using RxDB operators?
Interested in simple changes that can be made in RxDB:
1. how to find a message by its internal roomId and msg field?,
2. how to delete a message by its internal roomId and msg field?
3. how to add message to the required array if you know the roomId field?
4. how to update message by its internal roomId and msg field?
Ps How is "primary": true in the schema involved in all of this? And is it possible to make changes "directly" knowing where and what is stored in RxDB?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question