[DOCS-7108] Change GridFS to use getDatabase instead of getDB Created: 07/Feb/16  Updated: 30/Oct/23  Resolved: 13/May/19

Status: Closed
Project: Documentation
Component/s: drivers, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: collector-298ba4e7, docs-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 64bit, MongoDriver version 3.2.

Location: https://docs.mongodb.org/manual/?_ga=1.262378191.2119288918.1451580806
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36
Referrer: https://www.mongodb.org/
Screen Resolution: 1366 x 768
repo: docs
source: index


Participants:
Days since reply: 4 years, 39 weeks, 2 days ago
Epic Link: DOCSP-1769

 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.



 Comments   
Comment by Ravind Kumar (Inactive) [ 13/May/19 ]

There's not enough information to action this ticket. Specifically, this appears to be driver-centric, but without knowing which driver we can't really drive forward.

 

Further, there should be no distinction between `getDB()` and `getDatabase()`.  Both return the database object, which GridFS should support. Without additional error or bug logging, there's not much to do here. Closing.

Generated at Thu Feb 08 07:53:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.