Warning message in PyMongo: count is deprecated
The method count_documents
is part of the collection
, not the cursor
(find
returns a cursor).
Please see the PyMongo documentation regarding the method for more information and a note regarding some operators.
def post(self):
if db.users.count_documents({"email": email}) != 0:
abort(400, message="email is alread used.")