Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-1499

Unusual behavior when working with mongodb inside docker container using pymongo

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 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

      Attachments

        Activity

          People

            bernie@mongodb.com Bernie Hackett
            Abhijit-2592 ABHIJIT BALAJI [X]
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: