all method that take a DBObject, make a version that takes a map

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There are many places in the Mongo Java API that use the DBObject interface as parameter or return value. BasicDBObject is the most commonly used implementation of DBObject, which implements java.util.Map, but since none of the methods accept or return Map, we're forced to make intermediate BasicDBObject wrappers around objects that could otherwise be passed straight in. If these methods were updated to accept/return Maps, usage could be simpler and less onerous on user code.

      Below is a list of the spots in the API that could benefit (I think) from being updated:

      The DBObject interface could implement Map
      BasicDBObject - constructor could accept a Map
      DBCursor.toArray() - could return List<Map>
      DBCursor.curr(), explain(), next() could all return Map
      DBCollection - ensureIndex() and friends could accept Map
      DBCollection - find() & findOne() could accept Map
      DBCollection - getIndexInfo() could return List<Map>
      DBCollection - apply(), insert(), remove(), save(), update() could all accept Map

            Assignee:
            Kristina Chodorow (Inactive)
            Reporter:
            Liam Staskawicz
            None
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: