我想從我的android應用程序中將數據插入到MongoDB中。我看過很多例子,但他們沒有幫助。我是Android新手,請向我展示一個示例,我如何從Android應用程序向MongoDB插入行/文檔。我必須插入String
格式的數據。 (如下所示):如何將行/文檔插入到MongoDB中
String data = String.format("{\"document\" : {\"date\": \"%s\", \"latitude\": \"%s\", \"longitude\": \"%s\", \"name\": \"%s\"}, \"safe\" : true}", "24/6/1995", "33.642550", "72.990790", "Testing SL");