Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
None
Description
I am running Mongodb(3.6.3) in a server, inside a docker container. I use pymongo(3.6.1) to interact with mongodb. I remote access the database and the server from my system. When I run
db.command({'collMod':str(collectionName), |
'validator':{}, |
'validationLevel':'off', |
'validationAction':'warn'} |
)
|
It runs without any errors. But when I connect Compass GUI to the server, the above code fails with the following error.
pymongo.errors.OperationFailure: no such command: 'validator', bad cmd: '{ validator: {}, collMod: "TEST_SCHEMA_COLLECTION", validationAction: "warn", validationLevel: "off", lsid: { id: UUID("887cd35d-8295-4896-96d1-b32a0192ff89") }, $readPreference: { mode: "secondaryPreferred" }, $db: "TEST_SCHEMA_DB" }'
|
PS:
I installed MongoDB, pymongo, compass in my local system and tried the same code, it worked without errors. Thus this happens only when I am remotely accessing the mongodb in server