@@ -329,7 +329,7 @@ public final DBObject findOne( Object obj )
329
329
* @dochub find
330
330
*/
331
331
public final DBObject findOne ( Object obj , DBObject fields ) {
332
- Iterator <DBObject > iterator = __find (new BasicDBObject ("_id" , obj ), fields , 0 , -1 , 0 , getOptions (), _readPref , _decoderFactory .create () );
332
+ Iterator <DBObject > iterator = __find (new BasicDBObject ("_id" , obj ), fields , 0 , -1 , 0 , getOptions (), getReadPreference () , _decoderFactory .create () );
333
333
return (iterator != null ? iterator .next () : null );
334
334
}
335
335
@@ -565,7 +565,7 @@ public void setHintFields( List<DBObject> lst ){
565
565
* @dochub find
566
566
*/
567
567
public final DBCursor find ( DBObject ref ){
568
- return new DBCursor ( this , ref , null , _readPref );
568
+ return new DBCursor ( this , ref , null , getReadPreference () );
569
569
}
570
570
571
571
/**
@@ -592,7 +592,7 @@ public final DBCursor find( DBObject ref ){
592
592
* @dochub find
593
593
*/
594
594
public final DBCursor find ( DBObject ref , DBObject keys ){
595
- return new DBCursor ( this , ref , keys , _readPref );
595
+ return new DBCursor ( this , ref , keys , getReadPreference () );
596
596
}
597
597
598
598
@@ -602,7 +602,7 @@ public final DBCursor find( DBObject ref , DBObject keys ){
602
602
* @dochub find
603
603
*/
604
604
public final DBCursor find (){
605
- return new DBCursor ( this , null , null , _readPref );
605
+ return new DBCursor ( this , null , null , getReadPreference () );
606
606
}
607
607
608
608
/**
@@ -623,7 +623,7 @@ public final DBObject findOne()
623
623
*/
624
624
public final DBObject findOne ( DBObject o )
625
625
throws MongoException {
626
- return findOne ( o , null , _readPref );
626
+ return findOne ( o , null , getReadPreference () );
627
627
}
628
628
629
629
/**
@@ -634,7 +634,7 @@ public final DBObject findOne( DBObject o )
634
634
* @dochub find
635
635
*/
636
636
public final DBObject findOne ( DBObject o , DBObject fields ) {
637
- return findOne ( o , fields , _readPref );
637
+ return findOne ( o , fields , getReadPreference () );
638
638
}
639
639
/**
640
640
* Returns a single object from this collection matching the query.
0 commit comments