Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-1110

Mapping of List of Documents of type org.bson.Document to java.util.List of POJOs

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: All Tools

      Hi,

      We have employee Documents in MongoDB (Please see below for the sample) and we retrieve these documents in a list of org.bson.Document objects. We need to map this list of org.bson.Document objects to list of plain old java objects of type Employee. Please let me know if there is any API or library from MongoDB for doing the same.

      {
      "_id":ObjectId("231be1ae4e51b95"),
      "employeeId":"312000",
      "employeeName":"Peter",
      "employeeSal":21000.43,
      "creationDate":ISODate("2015-11-30T05:38:48.000+0000"),
      lastUpdateDate:ISODate("2015-11-30T05:38:48.000+0000"),
      "employAddress":[

      {"pinCode":1000.00, "address":"Kings Road"}

      {"pinCode":2000.00, "address":"George Street" }

      ]
      }

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            kiran_v Kiran Kumar V
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: