0
下面是我使用的代码:在源模型取下模型的列表中选择模型elasticSearch
"_source" : {
"name" : "hn name",
"user_id" : 553,
"email_id" : "[email protected]",
"lres_id" : "",
"hres_id" : "hn image",
"followers" : 0,
"following" : 1,
"mentors" : 2,
"mentees" : 2,
"basic_info" : "hn developer",
"birth_date" : 1448451985397,
"charge_price" : 3000,
"org" : "mnc pvt ltd",
"located_in" : "Noidasec51 ",
"position" : "jjunior ava developer",
"requests" : 0,
"exp" : 5,
"video_bio_lres" : "hn test lres url",
"video_bio_hres" : "hn hres url",
"ratings" : [ {
"rating" : 1,
"ratedByUserId" : 777
}, {
"rating" : 1,
"ratedByUserId" : 555
} ],
"avg_rating" : 0.0,
"status" : 0,
"expertises" : [ 3345, 1234, 2345 ],
"blocked_users" : [ ]
}
在下面的代码,我想删除的评价ratedByUserId 555而已。不过有些我如何,我无法为此。 如何做到这一点?
我ts working ... curl -XPOST'http:// localhost:9200/mentorz/users/555/_update'-d'{“script”:“ctx._source.ratings.remove(ratings)”,“params”: { “收视率”:{ “等级”:1, “ratedByUserId”:555}}}'; – User1703