|
Config:
storage:
|
dbPath: /data/shard2
|
replication:
|
replSetName: shard2
|
sharding:
|
clusterRole: shardsvr
|
net:
|
bindIp: localhost
|
port: 20002
|
If we ran the below command in a single-node replica set without being connected to mongoS, we see errors:
shard:PRIMARY> y = db.createCollection("stock", {changeStreamPreAndPostImages: {enabled: true}})
|
{
|
"ok" : 0,
|
"errmsg" : "BSON field 'changeStreamPreAndPostImages' is an unknown field.",
|
"code" : 5846900,
|
"codeName" : "Location5846900",
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1634565583, 6),
|
"signature" :
|
{ "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) }
|
},
|
"operationTime" : Timestamp(1634565583, 6)
|
}
|
But when we connect this shard to the mongoS, it works fine. I am running this command still in the same replica-set not in mongoS
shard:PRIMARY> y = db.createCollection("stock", {changeStreamPreAndPostImages: {enabled: true}})
|
{
|
"ok" : 1,
|
"lastCommittedOpTime" : Timestamp(1634565913, 3),
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1634565919, 1),
|
"signature" :
|
{ "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) }
|
},
|
"operationTime" : Timestamp(1634565919, 1)
|
}
|
We should explore this disparity.
|