Socket
Socket
Sign inDemoInstall

@andrewscwei/mongodb-odm

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@andrewscwei/mongodb-odm - npm Package Compare versions

Comparing version 0.18.0 to 0.19.0

8

build/core/Model.d.ts

@@ -75,2 +75,10 @@ /**

/**
* Returns an array of document IDs that match the query.
*
* @param query - Query for this model.
*
* @returns Array of matching IDs.
*/
static identifyMany(query?: Query): Promise<ObjectID[]>;
/**
* Finds one document from this collection using the aggregation framework. If

@@ -77,0 +85,0 @@ * no query is specified, a random document will be fetched.

@@ -155,2 +155,26 @@ "use strict";

/**
* Returns an array of document IDs that match the query.
*
* @param query - Query for this model.
*
* @returns Array of matching IDs.
*/
static identifyMany(query) {
return __awaiter(this, void 0, void 0, function* () {
const collection = yield this.getCollection();
const res = yield collection.aggregate([
...this.pipeline(query),
{
$group: {
_id: null,
ids: { $addToSet: '$_id' },
},
},
]).toArray();
if (res.length === 0)
return [];
return res[0].ids || [];
});
}
/**
* Finds one document from this collection using the aggregation framework. If

@@ -157,0 +181,0 @@ * no query is specified, a random document will be fetched.

2

package.json
{
"name": "@andrewscwei/mongodb-odm",
"version": "0.18.0",
"version": "0.19.0",
"description": "ODM for MongoDB",

@@ -5,0 +5,0 @@ "main": "build/index.js",

Sorry, the diff of this file is not supported yet

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