diff --git a/examples/petstore-access-control/controllers.py b/examples/petstore-access-control/controllers.py index b39b101..cfc6a3f 100644 --- a/examples/petstore-access-control/controllers.py +++ b/examples/petstore-access-control/controllers.py @@ -37,7 +37,7 @@ def addPet(pet): ) counter = 0 ctr = db_collection.find({}).sort([('$natural', -1)]) - if not ctr.count() == 0: + if not db_collection.count_documents({}) == 0: counter = ctr[0].get('id') + 1 record = { "id": counter, diff --git a/examples/petstore-access-control/docker-compose.yaml b/examples/petstore-access-control/docker-compose.yaml index f9a58de..cef463b 100644 --- a/examples/petstore-access-control/docker-compose.yaml +++ b/examples/petstore-access-control/docker-compose.yaml @@ -26,7 +26,7 @@ services: - "80:8080" mongodb: - image: mongo:3.6 + image: mongo:7.0 restart: unless-stopped volumes: - ./data/petstore-access-control/db:/data/db diff --git a/examples/petstore/controllers.py b/examples/petstore/controllers.py index 1bbd79f..b8fad83 100644 --- a/examples/petstore/controllers.py +++ b/examples/petstore/controllers.py @@ -32,7 +32,7 @@ def addPet(pet): ) counter = 0 ctr = db_collection.find({}).sort([('$natural', -1)]) - if not ctr.count() == 0: + if not db_collection.count_documents({}) == 0: counter = ctr[0].get('id') + 1 record = { "id": counter, diff --git a/examples/petstore/docker-compose.yaml b/examples/petstore/docker-compose.yaml index 36bd6a6..cb41b87 100644 --- a/examples/petstore/docker-compose.yaml +++ b/examples/petstore/docker-compose.yaml @@ -26,7 +26,7 @@ services: - "80:8080" mongodb: - image: mongo:3.6 + image: mongo:7.0 restart: unless-stopped volumes: - ./data/petstore/db:/data/db diff --git a/requirements.txt b/requirements.txt index f7427c6..2a549a2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ Flask-Cors==4.0.1 Flask-PyMongo==2.3.0 pydantic==1.10.13 PyJWT==2.4.0 -pymongo==3.10.1 +pymongo==4.7.2 PyYAML==6.0.1 requests==2.31.0 swagger-ui-bundle==0.0.6