I am doing the examples from quick start
//the code from the link example,set registry etc MongoDatabase db = mongoClient.getDatabase("sample_training"); MongoCollection<Grade> grades = db.getCollection("grades", Grade.class); grades.find(); //works i get cursor of Grade instances //THIS DOESNT WORK Document find_command = new Document().append("find","grades"); db=db.withCodecRegistry(codecRegistry); db.runCommand(find_command,Grade.class); //doesnt work,i get 1 Grade instance with null fields db.runCommand(find_command); //doesnt work,i get a cursor with Documents not Grade instances
1)how to fix the runCommand to get a cursor Document where “firstBatch” will be an Arraylist of Grade instances (i need it because i am making a library)
2)when i use POJO i have perfomance penalty?
i mean at insert time it goes Grade -> Document -> BSON or Grade->BSON?
at read(decode) it goes BSON->Document->Grade or BSON->Grade?