@chaddjohnson/mongodb-client-lambda

Mongoose client wrapper for use with Lambda and non-Lambda environments.

Usage no npm install needed!

<script type="module">
  import chaddjohnsonMongodbClientLambda from 'https://cdn.skypack.dev/@chaddjohnson/mongodb-client-lambda';
</script>

README

Mongoose Client Wrapper

Optimized for use with Lambda, but still compatible with non-Lambda environments.

This library takes care of the following:

  1. Allow connections to multiple MongoDB databases (rather than assuming only one via mongoose.connection).
  2. Set optimal connection default settings geared toward Lambda (but allow overrides for non-Lambda environments).
  3. Provide convenience method for checking if the client is connected or connecting.
  4. Provide convenience method for disconnecting the client.