1

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 Answers 2

0

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

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.