I have some mongodb queries that are returning 1000 results, when I look in the mongodb.com profiler it shows me this:
{
"command": {
"getMore": 8223354687588024000,
"collection": "reservations",
"batchSize": 1000,
"lsid": {
"id": {
"$binary": {
"base64": "n8eH91eURw+xpT6fNEPURQ==",
"subType": "04"
}
}
},
"$clusterTime": {
"clusterTime": {
"$timestamp": {
"t": 1659066401,
"i": 542
}
},
"signature": {
"hash": {
"$binary": {
"base64": "PHh4eHh4eD4=",
"subType": "00"
}
},
"keyId": 7090947493382324000
}
},
"$db": "superhosttools"
},
"originatingCommand": {
"aggregate": "reservations",
"pipeline": [
{
"$changeStream": {
"fullDocument": "updateLookup"
}
}
],
"cursor": {},
"lsid": {
"id": {
"$binary": {
"base64": "n8eH91eURw+xpT6fNEPURQ==",
"subType": "04"
}
}
},
"$clusterTime": {
"clusterTime": {
"$timestamp": {
"t": 1659064839,
"i": 29
}
},
"signature": {
"hash": {
"$binary": {
"base64": "PHh4eHh4eD4=",
"subType": "00"
}
},
"keyId": 7090947493382324000
}
},
"$db": "superhosttools"
},
"planSummary": [
{
"COLLSCAN": {}
}
],
"cursorid": 8223354687588024000,
"keysExamined": 0,
"docsExamined": 26879,
"numYields": 210,
"nreturned": 1000,
"reslen": 15283228,
"locks": {
"ReplicationStateTransition": {
"acquireCount": {
"w": 2206
}
},
"Global": {
"acquireCount": {
"r": 2206
}
},
"Database": {
"acquireCount": {
"r": 2206
}
},
"Collection": {
"acquireCount": {
"r": 1994
}
},
"Mutex": {
"acquireCount": {
"r": 1996
}
},
"oplog": {
"acquireCount": {
"r": 211
}
}
},
"storage": {
"data": {
"bytesRead": 2083760,
"timeReadingMicros": 4772
}
},
"protocol": "op_msg",
"millis": 249,
"v": "4.2.21"
}
This looks like the interesting part and we use change streams but I don’t know why we would get 1000 results:
"pipeline": [
{
"$changeStream": {
"fullDocument": "updateLookup"
}
}
],