I have a document that looks like this:
{
"id":1,
"layers":
[{
"id" : 100,
"files": [{
"id":1,
"name":"test"
}]
}]
}
@Document(collections="tests")
public class Test() {
string id
Set<..> layers;
}
public class Layers() {
List<..> files;
}
Is it possible (given a documentId and and layerId) to add a new file object in one query ? something like
db.test.update(
{ _id: 1 },
{ $push:
{
"layers.100.files": {"id":2,"name":"test2:}
}
}
)
when I try the above I get an error like: cannot use the part (contentLayers ....) to traverse the element ....