Skip to content

Commit 415552d

Browse files
author
rstam
committed
CSHARP-553: change the order of $readPreference and $query from the documented order to the order that actually works.
1 parent 10826e1 commit 415552d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Driver/Core/MongoCursorEnumerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ private IMongoQuery WrapQuery()
366366
var query = (_cursor.Query == null) ? (BsonValue)new BsonDocument() : BsonDocumentWrapper.Create(_cursor.Query);
367367
var wrappedQuery = new QueryDocument
368368
{
369+
{ "$query", query },
369370
{ "$readPreference", formattedReadPreference, formattedReadPreference != null }, // only if sending query to a mongos
370-
{ "$query", query }
371371
};
372372
wrappedQuery.Merge(_cursor.Options);
373373
return wrappedQuery;

0 commit comments

Comments
 (0)