|
I have a trouble with my code, using mongodb c# driver. This trouble looks like the one described here : http://www.ciiycode.com/0iiBNWWexjex/how-to-update-items-in-an-arraylist-with-mongo-c-driver.html which seems to have been solved.
I want to update a bi-dimensionnal array in my document. If I use
myarray[0,3]
it works, however if I use variable like
int a = 0;
int b = 3;
myarray[a,b]
it gives me a "Unable to determine the serialization information for the expression ..." error
Full code :
int a = 0;
|
int b = 3;
|
var update = Builders<sensorValuesDocument>.Update
|
.Set(e => e.values[a][b]
|
, new sensorValues()
|
{
|
v = 0,
|
t = 0,
|
h = 0,
|
c = 0,
|
l = 0
|
}) ...
|
and my document class :
public class sensorValuesDocument
|
{
|
...
|
public List<List<sensorValues>> values { get; set; }
|
...
|
}
|
|
public class sensorValues
|
{
|
[BsonRepresentation(BsonType.Double, AllowTruncation = true)]
|
public float? t { get; set; }
|
[BsonRepresentation(BsonType.Double, AllowTruncation = true)]
|
public float? v { get; set; }
|
[BsonRepresentation(BsonType.Double, AllowTruncation = true)]
|
public float? h { get; set; }
|
[BsonRepresentation(BsonType.Double, AllowTruncation = true)]
|
public float? l { get; set; }
|
[BsonRepresentation(BsonType.Double, AllowTruncation = true)]
|
public float? c { get; set; }
|
}
|
|