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

Deprecate DBRef.fetch and DBRefBase

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.13.0
    • Affects Version/s: None
    • Component/s: API
    • None

      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.

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

              Created:
              Updated:
              Resolved: