@oculushealth/mongo

Mongo wrapper

Usage no npm install needed!

<script type="module">
  import oculushealthMongo from 'https://cdn.skypack.dev/@oculushealth/mongo';
</script>

README

@oculushealth/mongo

MongoDB package that is used in the Oculushealth projects.

Example usage

import {
  connect,
  disconnect,
  getDatabase,
  getCollection,
  generateId
} from "@oculushealth/mongo";

(async function() {
  await connect();
  const Users = await getCollection("users");
  const user = await Users.findOne({});
  await Users.insert({
    _id: generateId()
    /* Other fields */
  });
  await disconnect();
})();