Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ydv/mongo

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ydv/mongo - npm Package Compare versions

Comparing version 2.2.3 to 2.2.5-beta.0

bitbucket-pipelines.yml

4

index.js
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
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc