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

Deprecate DBRef.fetch and DBRefBase

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.13.0
    • None
    • API
    • None

    Description

      The fact that DBRef needs to be constructed with a DB instance so that the reference can be fetched means that the class can only be used in a context where a DB is available. This is not going to be the case when using the new CRUD API. In addition, the fetch method is limited in that you can't specify, for example, a read preference when fetching. Since fetch is easily implemented in client code by getting the collection name and id from the DBRef and calling findOne, this method will be deprecated.

      Also, DBRefBase will be deprecated since DBRef is the only non-deprecated subclass.

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: