@@ -107,8 +107,6 @@ func (op Operation) createLegacyFindWireMessage(dst []byte, desc description.Sel
107
107
optsElems = bsoncore .AppendValueElement (optsElems , "$hint" , elem .Value ())
108
108
case "comment" :
109
109
optsElems = bsoncore .AppendValueElement (optsElems , "$comment" , elem .Value ())
110
- case "maxScan" :
111
- optsElems = bsoncore .AppendValueElement (optsElems , "$maxScan" , elem .Value ())
112
110
case "max" :
113
111
optsElems = bsoncore .AppendValueElement (optsElems , "$max" , elem .Value ())
114
112
case "min" :
@@ -141,7 +139,7 @@ func (op Operation) createLegacyFindWireMessage(dst []byte, desc description.Sel
141
139
flags |= wiremessage .TailableCursor
142
140
case "awaitData" :
143
141
flags |= wiremessage .AwaitData
144
- case "oplogReply " :
142
+ case "oplogReplay " :
145
143
flags |= wiremessage .OplogReplay
146
144
case "noCursorTimeout" :
147
145
flags |= wiremessage .NoCursorTimeout
@@ -560,8 +558,12 @@ func (op Operation) createLegacyListIndexesWiremessage(dst []byte, desc descript
560
558
switch elem .Key () {
561
559
case "listIndexes" :
562
560
filterCollName = elem .Value ().StringValue ()
563
- case "batchSize" :
564
- batchSize = elem .Value ().Int32 ()
561
+ case "cursor" :
562
+ // the batchSize option is embedded in a cursor subdocument
563
+ cursorDoc := elem .Value ().Document ()
564
+ if val , err := cursorDoc .LookupErr ("batchSize" ); err == nil {
565
+ batchSize = val .Int32 ()
566
+ }
565
567
case "maxTimeMS" :
566
568
optsElems = bsoncore .AppendValueElement (optsElems , "$maxTimeMS" , elem .Value ())
567
569
}
0 commit comments