To update elements of a mongo array, I was using syntax like:
{"$set":{"a.0":1238},{"a.1":402}}
Or, more accurately, I was using the C-driver function calls that I think are equivalent to that. This seemed to work fine, but when I look at the object in MongoHub, I see:
a: {"0":1238,"1":402}
instead of:
a: [1238,402]
Does anyone know what is proper syntax to access array elements by index with C-driver? What I am doing now serves my immediate purpose, but I am not sure if there are significant performance differences. Also, I might later need to use operations that require true array.