1
votes

I am using MongoDB with a Java Driver. Maven ID is GroupID: org.mongodb, ArtifactId: mongo-java-driver, Version: 2.7.2.

I have a collection of documents. In each document there are 2 arrays. I am loading the document like this.

DBCollection products = getCollection();
BasicDBObject match = new BasicDBObject();
match.put(Product.PROD_KEY, key);
DBCursor cursor = products.find(match);

I get my document, and all attributes. The first array in the document is loaded perfectly. The second array is just missing. It is not included in the DBObject!

If I load the same document with Ruby (MongoID) I get all 2 arrays. For me that seems like a Bug in the Java Driver.

Or do I have to do something to enforce the loading of all arrays/subdocuments?

Thanks.

2

2 Answers

0
votes

No, friend there is no mistake with java driver , i am doing same thing with same driver.

enter image description here

0
votes

Sorry. My mistake. It was friday night and I just used the wrong database. The driver works perfectly.