Efficient way for updating a nested array in a document

It is best to put each batch of sensor readings into it’s own document. In general it is bad to append to a document, as it might grow forever. Instead it is better to have lots of documents, and use a view to sort them.

If every reading is it’s own document, that could be too many, but buffering the readings in memory and then writing them out to a document ~ once per second, is probably the easiest on the hardware, and easy enough to work with.

1 Like