diff --git a/django_q/brokers/mongo.py b/django_q/brokers/mongo.py
index <HASH>..<HASH> 100644
--- a/django_q/brokers/mongo.py
+++ b/django_q/brokers/mongo.py
@@ -36,10 +36,10 @@ class Mongo(Broker):
         return self.connection[Conf.MONGO_DB][self.list_key]
 
     def queue_size(self):
-        return self.collection.count({"lock": {"$lte": _timeout()}})
+        return self.collection.count_documents({"lock": {"$lte": _timeout()}})
 
     def lock_size(self):
-        return self.collection.count({"lock": {"$gt": _timeout()}})
+        return self.collection.count_documents({"lock": {"$gt": _timeout()}})
 
     def purge_queue(self):
         return self.delete_queue()
diff --git a/django_q/tests/urls.py b/django_q/tests/urls.py
index <HASH>..<HASH> 100644
--- a/django_q/tests/urls.py
+++ b/django_q/tests/urls.py
@@ -1,6 +1,6 @@
-from django.conf.urls import url
+from django.urls import re_path
 from django.contrib import admin
 
 urlpatterns = [
-    url(r'^admin/', admin.site.urls),
+    re_path(r'^admin/', admin.site.urls),
 ]
Fixes deprecated count method (#<I>)

* Replaces deprecated count with count_documents



* Uses new re_path instead of url()