2012-04-07 76 views

回答

1

感謝:

{ivalues:[{i:1},{i:9},{i:10}]} 

那麼你應該能夠在創建文檔Java如下:

ArrayList<DBObject> x = new ArrayList<DBObject>(); 
x.add(new BasicDBObject("i", 1)); 
x.add(new BasicDBObject("i", 9)); 
x.add(new BasicDBObject("i", 10)); 
BasicDBObject doc = new BasicDBObject("ivalues", x); 

並保存/檢索它正常。

相關問題