1.0.2 • Published 6 years ago

uam-models v1.0.2

Weekly downloads
-
License
MIT
Repository
bitbucket
Last release
6 years ago

models

Instalation

  npm i --save uam-models

Content

This package contains functionality for the following services: 1. Accounts

The code use mongoose for connecting the database. Mongo Connection string is stored in environment variables for example: MONGO_ATLAS_URI_ACCOUNTS=''

Usage

Users

  import { User } from 'uam-models';
  import { Mongoose } from 'mongoose';

  const userConnection = new Connection(
    process.env.MONGO_ATLAS_URI_ACCOUNTS as string,
    {
      useNewUrlParser: true,
      useFindAndModify: false,
      useCreateIndex: true
    },
    new Mongoose()
  );

  const user = new User(userConnection.createConnection());

If we want to use mongoose functionality in everywhere, just use as those examples:

  user.model().find()
  user.model().findById()
  user.model().create()
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago