Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 377 Bytes

README.md

File metadata and controls

24 lines (21 loc) · 377 Bytes

@useful/mongo

Example usage

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

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