accessing database via mongoose for queries