@ydv/mongo
Advanced tools
Comparing version 2.2.3 to 2.2.5-beta.0
const omit = require('lodash/omit') | ||
const mongoose = require('mongoose') | ||
const mongooseLeanVirtuals = require('mongoose-lean-virtuals') | ||
const Logger = require('@ydv/logger') | ||
const log = Logger('@ydv/mongo') | ||
const log = Logger('@ydv/mongo') | ||
exports.db = mongoose // need this for transactions | ||
var __setOptions = mongoose.Query.prototype.setOptions | ||
@@ -9,0 +11,0 @@ mongoose.Query.prototype.setOptions = function (options, overwrite) { |
{ | ||
"name": "@ydv/mongo", | ||
"version": "2.2.3", | ||
"version": "2.2.5-beta.0", | ||
"repository": "YottaDV/mongo", | ||
@@ -11,2 +11,3 @@ "scripts": { | ||
"dependencies": { | ||
"define-error": "^1.1.0", | ||
"@ydv/logger": "^1.0.4", | ||
@@ -13,0 +14,0 @@ "lodash": "^4.17.10", |
@@ -23,2 +23,28 @@ ### @ydv/mongo | ||
Find method in Model class is redifined so that all the find queries return a result equivaluent to find(args).lean(). | ||
Find method in Model class is redifined so that all the find queries return a result equivaluent to find(args).lean(). | ||
``` | ||
## Sequencer | ||
Example:- | ||
```js | ||
const { getNextSequence } = require('@teamfabric/mongo/sequence') | ||
const Model = require('../model') | ||
const sequence = await getNextSequence({ collectionName: Model.collection.collectionName, | ||
incrementBy: 10, | ||
startAt: 1000 }) | ||
// sequence -> 1000 | ||
``` | ||
```js | ||
const { getNSequences } = require('@teamfabric/mongo/sequence') | ||
const Model = require('../model') | ||
const sequence = await getNSequences({ collectionName: Model.collection.collectionName, | ||
count: 3, | ||
incrementBy: 10, | ||
startAt: 1000 }) | ||
// sequence -> 1000, 10010, 10020 | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10711
8
284
49
5
2
2
2
+ Addeddefine-error@^1.1.0
+ Addeddefine-error@1.1.0(transitive)