Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-7108

Change GridFS to use getDatabase instead of getDB

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • drivers, Server

    Description

      Hi there, it is Muhammad Faisal Hyder, student of BE in CiS Engg. I am using MongoDB for my fyp and when i came to use GridFS for images and videos there is an issue i am facing,

      DB mDB =  mClient.getDB("mydb");  // Deprecated
      MongoDatabase mDataBase = mClient.getDatabase("mydb");//substitute of getDB
       
      GridFS gridFS = new GridFS(mDB,"myCollection");
      

      but in gridFS we have to use old way of getting database i.e. DB's object
      kindly fix this issue of GridFS for MongoDatabase instance or is there any other way to get it done without using deprecated method.

      Attachments

        Activity

          People

            Unassigned Unassigned
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              4 years, 39 weeks, 2 days ago