Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1720

Add getDocument() and getArray() functions to the new Document class

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.10.0
    • 3.0.0
    • API
    • None

    Description

      In the old api i had to make frequently casts like this

      BasicDBList points = ((BasicDBList) ((BasicDBObject) currentObject.get("poly")).get("coordinates"));
      

      If the Document class had functions like this

      Document getDocument(String key); <- sub document
      List<Document> getDocumentArray(String key); <- Array of sub documents
      List<Object> getArray(String key); <- Array of other objects
      

      i could avoid such casts

      Attachments

        Activity

          People

            john.stewart@mongodb.com John Stewart (Inactive)
            wutzebaer Peter
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: