New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mongoose-sort-encrypted-field

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose-sort-encrypted-field - npm Package Compare versions

Comparing version 0.2.18 to 0.2.19

12

lib/utils.js

@@ -42,3 +42,6 @@ "use strict";

endValue = ignoreCases ? endValue.toLowerCase() : endValue;
if (fieldValue < midValue) {
if (fieldValue === midValue) {
return midDoc[sortFieldName];
}
else if (fieldValue < midValue) {
end = mid - 1;

@@ -50,3 +53,3 @@ if (end < 0) {

}
else if (midValue <= fieldValue) {
else if (midValue < fieldValue) {
start = mid + 1;

@@ -127,6 +130,7 @@ if (start === n) {

let curr = new Base2N("\0", 16, noOfCharsForSortId);
curr = curr.add(diff);
for (let i = 0; i < n; i += 1) {
if (i === 0 || documents[i - 1][fieldName] !== documents[i][fieldName]) {
curr = curr.add(diff);
}
await model.updateOne({ _id: documents[i]._id }, { $set: { [sortFieldName]: curr.toString() } });
curr = curr.add(diff);
}

@@ -133,0 +137,0 @@ if (!silent) {

{
"name": "mongoose-sort-encrypted-field",
"version": "0.2.18",
"version": "0.2.19",
"description": "Mongoose plugin to enable sorting on encrypted fields",

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

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