Good morning,
first of all sorry for my log english knoleage and my low java and mongodb skills.
I was working last year with GAS and mongodb with great result but now im moving to java apps and there comes all the problems.
But Im not sure how in mongodb-java-driver you can select diferent parts inside the Bson(Document) object.
In javascript all is very easy, you parse the object to javascript object and then simply use (check file for example json):
MyData = MyJson.battleground_effects.global[0],name;
And then you get the deire name.
But in java im totally lost, when I get the data from database it is a Bson (Document) and waht I see (toString() is:
Document{{_id=571719a1e4b07036ddd4d591, battleground_effects=Document{{global=[Document{{name=Zealot's Preservation, id=94}}], yeffect=[], eeffect=[]}}, yfort=[Document{{name=Inspiring Altar-4, card_id=2903}}, Document{{name=Inspiring Altar-3, card_id=2902}}], efort=[Document{{name=Foreboding Archway-4, car_id=2715}}, Document{{name=Illuminary Blockade-4, car_id=2727}}], player=tweggiejack, user_id=2254143, enemy=116. Paradox?-Zealot's Preservation-Inspiring Altar-4-Inspiring Altar-3-Foreboding Archway-4-Illuminary Blockade-4, mode=gq, type=offense, gauntlet=116. Paradox?, date=1461131615, caducity=1461150001, quest=, flags=[], trim=-L 5 10, complete=true, deck=Document{{commander=Document{{}}, cards=[]}}, funds=0, win_rate=0, status=simming}}
Then I notice that each time I must get() any subdocumet and cast to Document every time, like this:
String MyData = ((Document)((Document)MyDocument.get("battleground_effects")).get("global")) .. .. ..
Sincerelly I pretty sure that I dint understand something due that looks very more complex than javascript usage.
Whast the correct way to acces any property inside the Document ?
Thx in advance and sorry for my inexperience with java and mode-java-driver.