This is my current code
Document bitcoin = new Document("Currency", "Bitcoin").append("Values", Arrays.asList());
//bitCoinCollection.insertOne(bitcoin);
for(int i = 0; i<100;i++){
BasicDBObject setNewFieldQuery = new BasicDBObject()
.append("$set", new BasicDBObject().append("value", 100));
mongoClient.getDatabase("Binance").getCollection("Binance")
.updateOne(new BasicDBObject().append("_id", "tjena"), setNewFieldQuery);
}
It doesnt add any values to the excisting arraylist... is there a way to add it to an excisting arraylist in a document? Thanks in advance