0
我希望檢索字符串數組或ArrayList(Java)中的「comment」字段的值。請參考圖片鏈接或指定了以下的MongoDB條目:如何使用java檢索mongodb中文檔字段的值列表?
{
"_id" : ObjectId("56740295f0a1e82444261cd4"),
"Title" : "Campus",
"Description" : "Nice",
"City" : "Delhi",
"Venue" : "Paschim Vihar",
"Lab" : "Lab1",
"Tags" : [ "people", " building" ],
"UploadDate" : ISODate("2015-12-18T12:56:51.589Z"),
"MediaCreationDate" : ISODate("0015-01-09T18:41:00Z"),
"Likes" : 0,
"Dislikes" : 0,
"Video Hash" : "56740295f0a1e82444261cd4157",
"Url" : "56740295f0a1e82444261cd4157",
"comments" : [ "Hello Sir", "Hello World" ]
}
只是一個初學者。謝謝。
不知道在什麼地方你需要幫助..讀取數據或將它們轉換。從數組轉換爲列表,看看這個:[從數組創建ArrayList](http://stackoverflow.com/questions/157944/create-arraylist-from-array) –