I have a MongoDb ATLAS database as "BOULDERS_MAIN" and a collection inside it "users", I am writing a webhook function for returning a user based on email i.e. "kb", but all I'm getting is empty object.
MongoDB's find()
returns a cursor object not the results. Try calling toArray() on the result instead:
var doc = users.find({email: 'kb'}).toArray();