Thanks for your response!!!
I just showed up a single document with 2 array lists.
Is there any way to get them all with one query?
For example: // The code i tried,
BasicDBObject query = new BasicDBObject();
BasicDBObject field = new BasicDBObject();
field.put("PreviewSize", 1);
DBCursor cursor = coll.find(query, field);
while(cursor.hasNext()){
BasicDBObject result = (BasicDBObject) cursor.next();
int i = result.size();
String imageName = (String) ((BasicDBList)
result.get("PreviewSize")).get("ImageName");
System.out.println("Result Size: "+i+" Image Name :"+imageName);
byte[] imageByte = (byte[]) ((BasicDBList)
result.get("PreviewSize")).get("BinaryImage");
if(imageByte != null){System.out.println("Wow! Great!!! Its
Coming!!!");}
else{System.out.println("Try Another Way!");}
}// I am not sure this is exist(I am new to mongoDB). I need
something like that.
/* Some thing like the above list contains All contents of the
"PreviewSize" data <ImageName> & <BinaryData>.*/
I tried the above one, and the error message i got in the comsole is,
"Exception in thread "main" java.lang.IllegalArgumentException:
BasicBSONList can only work with numeric keys, not: [ImageName]"
I am totally new to mongoDB, like 3 days old :( .... Give me a way
out!!!!
And, i also want to know is there any way to retrieve specific data,
Like, if i know the "ImageName" can i get its BinaryData??