2.0.7 • Published 10 months ago

@am92/mongo-odm v2.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@am92/mongo-odm

npm version  ECMAScript Module  License: MIT  Vulnerabilities: Snyk  Downloads Bundle Size

This is an ODM (Object Document Mapping) which provides CRUD functionalities to interact with MongoDB Collections. This package uses mongoose package using its 8.4.1 version.

This package provides the following functionalities:

  • MongoDB Connection Helper
  • Mongoose Schema Wrapper
  • Collection Modeling Class

Table of Content

Installation

npm install --save @am92/mongo-odm

Environment Variables

The following environment variables need to be set to work with this package:

##### Mongo Config
export MONGO_HOSTS=
export MONGO_DBNAME=
export MONGO_USER_AUTH=false
export MONGO_USERNAME=
export MONGO_PASSWORD=
export MONGO_REPLICASET=
export MONGO_REPLICASET_COUNT=0
export MONGO_READ_PREFERENCE=
export MONGO_SSL_ENABLED=false
export MONGO_SSL_VALIDATE=false
export MONGO_PEM_PATH=
export MONGO_MIN_POOL_SIZE=0
export MONGO_MAX_POOL_SIZE=100

Note: Do not export variable 'MONGO_READ_PREFERENCE' if no value is to be set.

Connecting to MongoDB

MongoDB needs to be connected before the 'Model' methods can executed. The connection can be established as shown below:

import { mongoConnect } from '@am92/mongo-odm'
await mongoConnect()

Contributors

Resources

License

1.1.9

11 months ago

2.0.3

11 months ago

2.0.2

11 months ago

2.0.5

10 months ago

2.0.4

11 months ago

2.0.7

10 months ago

2.0.6

10 months ago

2.0.1

11 months ago

2.0.0

11 months ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

2 years ago

1.1.1

2 years ago

1.0.19

2 years ago

1.1.0

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.0

2 years ago