Validate_lab_document_chunks - Error unknown top level operator $expr

I have trouble validating the result of Lab 3.3:

# /var/m103/validation/validate_lab_document_chunks <my-answer>

Error - could not run query on database/collection: config/chunks
failed to execute update: (BadValue) unknown top level operator: $expr

I’ve tried to google, but haven’t found out what this error means…

mongos> sh.status()
— Sharding Status —
sharding version: {
“_id” : 1,
“minCompatibleVersion” : 5,
“currentVersion” : 6,
“clusterId” : ObjectId(“5e4bdb508c84dd9b94cba038”)
}
shards:
{ “_id” : “m103-repl”, “host” : “m103-repl/192.168.103.100:27001,m103:27002,m103:27003”, “state” : 1 }
{ “_id” : “m103-repl-2”, “host” : “m103-repl-2/192.168.103.100:27004,192.168.103.100:27005,192.168.103.100:27006”, “state” : 1 }
active mongoses:
“3.4.1” : 1
autosplit:
Currently enabled: yes
balancer:
Currently enabled: yes
Currently running: no
Balancer lock taken at Tue Feb 18 2020 12:40:48 GMT+0000 (UTC) by ConfigServer:Balancer
Failed balancer rounds in last 5 attempts: 3
Last reported error: Cannot accept sharding commands if not started with --shardsvr
Time of Reported error: Tue Feb 18 2020 12:55:18 GMT+0000 (UTC)
Migration Results for the last 24 hours:
2 : Success
databases:
{ “_id” : “applicationData”, “primary” : “m103-repl”, “partitioned” : false }
{ “_id” : “testDatabase”, “primary” : “m103-repl”, “partitioned” : false }
{ “_id” : “m103”, “primary” : “m103-repl-2”, “partitioned” : true }
m103.products
shard key: { “sku” : 1 }
unique: false
balancing: true
chunks:
m103-repl 1
m103-repl-2 2
{ “sku” : { “$minKey” : 1 } } -->> { “sku” : 23153496 } on : m103-repl Timestamp(2, 0)
{ “sku” : 23153496 } -->> { “sku” : 28928914 } on : m103-repl-2 Timestamp(2, 1)
{ “sku” : 28928914 } -->> { “sku” : { “$maxKey” : 1 } } on : m103-repl-2 Timestamp(1, 2)

Got it!
I was running mongo 3.4.x instead of 3.6.x…

The vagrant/virutalbox thing didn’t work out for me, so I’m running a docker variant instead.

1 Like

The vagrant machine installs 3.6.17, so it appears that the vagrant up wasn’t a complete provisioning.

Closing this thread as the issue has been resolved.