2.2.4 • Published 5 years ago

@ydv/mongo v2.2.4

Weekly downloads
27
License
-
Repository
github
Last release
5 years ago

@ydv/mongo

npm install --save @ydv/mongo

Exports db helpers and mongoose.

Expects process.env.MONGO_URL to be set for connection!!

const { db, Types, Model, Schema } = require('@ydv/mongo)

db; // db is just a copy of require('mongoose')

Types; // shorthand for mongoose.Schema.Types.
       // e.g. Types.ObjectId === mongoose.Schema.Types.ObjectId.

Model; // wrapper to create a mongoose model with some defaults/fixes for Lambda.

Schema; // wrapper to create a mongoose Schema with some defaults.

Find method in Model class is redifined so that all the find queries return a result equivaluent to find(args).lean().
2.2.4

5 years ago

2.2.5-beta.0

5 years ago

2.2.3

6 years ago

2.2.0

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.0

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago