Quick and hopefully easy question.
DBObject res = collection.findOne(new BasicDBObject("_id",id));
// some_array is just an array of strings
Arr = res.get("some_array");
What type does Arr need to be? String[]? ArrayList?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Java driver will return arrays within the document as a
List– for your example, you would want Arr to be aList<String>.