MongoTemplate pull subdocument
问题 I need to pull a subdocument in MongoTemplate but cannot figure out how to do it. My saved document is: { "_id" : "FooUser", "_class" : "com.domain.User", "tests" : [ { "variant" : { "_id" : "C", "probability" : "0.5" }, "experiment" : { "$ref" : "experiment", "$id" : "MyExperiment2" } }, { "variant" : { "_id" : "B", "probability" : "0.5" }, "experiment" : { "$ref" : "experiment", "$id" : "MyExperiment1" } } ] } I need to remove only the test that has MyExperiment1. Executing the following