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

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • All Tools

    Description

      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" }

      ]
      }

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: