[JAVA-1744] Why DBCollection.findOne() is remove in 3.0 ? Created: 02/Apr/15  Updated: 11/Sep/19  Resolved: 03/Apr/15

Status: Closed
Project: Java Driver
Component/s: API
Affects Version/s: 3.0.0
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Pierre-Alban DEWITTE Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Why DBCollection.findOne is remove in 3.0 ? In 2.13 it was not deprecated so we don't have a easy path to migrate.



 Comments   
Comment by Pierre-Alban DEWITTE [ 03/Apr/15 ]

Thanks fou
That is exactly was i was trying to do. I should read the doc prior to migrate code.

Comment by Jeffrey Yemin [ 02/Apr/15 ]

It's still there: http://api.mongodb.org/java/3.0/?com/mongodb/DBCollection.html

It's just not in the brand new MongoCollection class, though. Is that what you're trying to migrate to? If so, see http://mongodb.github.io/mongo-java-driver/3.0/driver/getting-started/quick-tour/, which shows the equivalent for MongoCollection:

    collection.find().first();

Generated at Thu Feb 08 08:55:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.