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

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

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.10.0
    • Affects Version/s: 3.0.0
    • Component/s: API
    • None

      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

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

              Created:
              Updated:
              Resolved: