Noob: Java uses Dot notation to access Bson fileds?

93 views
Skip to first unread message

Oscar themacboy

unread,
Apr 20, 2016, 10:47:29 AM4/20/16
to BSON
Im new in java driver usage, las year I always used Javascript and paser all Documents to native javascript objects that use dot notation to access all his fields.

Currently I learning about java and mongodb but I dint understand how to do that:

Document:

{
  "effects": {
    "global": [
      {
        "name": "Preservation",
        "id": "94"
      }
    ],
    "yeffect": [],
    "eeffect": []
  }
}

Javascript:

MyDocument.effects.global[0].name = Preservation;

Java:

(Document)((Document)MyDocument.get("effects")) ... ... ... = ...

Really im not sure what Im doing, not sure if  lack about java knoleage or dint understand Bson library.


Thx in advance
Reply all
Reply to author
Forward
0 new messages