Hi,
I’m implementing a sensor logging framework and need to save high frequency accelerometer data.
My document is basically structured like this:
{
"name":"sensorlog01",
"data":[
{"timestamp":4332, "value":"123"},
{"timestamp":4333, "value":"122"}
]
}
Assuming we already have 10.000 measurements in this structure, is it possible to efficiently update the array appending some new values, as you would do when writing to a file or adding new rows to a relational database table?
In Swift, currently I need to copy the array around in memory. Is there a more efficient way than this:
var newValues = newRev.properties["data"] as [[String:AnyObject]]
newValues.append(["timestamp":123, "value":567])
newRev["data"] = newValues
How does Couchbase Lite handle those updates, is the whole array rewritten to the database?
Thanks for advices