Socket
Socket
Sign inDemoInstall

mongoose

Package Overview
Dependencies
Maintainers
0
Versions
884
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongoose - npm Package Compare versions

Comparing version 1.1.21 to 1.1.22

lib/mongoose/.query.js.swp

5

History.md
1.1.22 / 2011-03-31
===================
* Fixed; $in queries on mixed types now work
1.1.21 / 2011-03-31

@@ -3,0 +8,0 @@ ===================

2

lib/mongoose/index.js

@@ -284,3 +284,3 @@

exports.version = '1.1.21';
exports.version = '1.1.22';

@@ -287,0 +287,0 @@ /**

@@ -39,3 +39,3 @@

Mixed.prototype.checkRequired = function (value) {
Mixed.prototype.checkRequired = function (val) {
return true;

@@ -51,7 +51,10 @@ };

Mixed.prototype.cast = function (value) {
return value;
Mixed.prototype.cast = function (val) {
return val;
};
Mixed.prototype.castForQuery = Mixed.prototype.cast;
Mixed.prototype.castForQuery = function ($cond, val) {
if (arguments.length === 2) return val;
return $cond;
};

@@ -58,0 +61,0 @@ /**

{
"name": "mongoose"
, "description": "Mongoose MongoDB ORM"
, "version": "1.1.21"
, "version": "1.1.22"
, "author": "Guillermo Rauch <guillermo@learnboost.com>"

@@ -6,0 +6,0 @@ , "keywords": ["mongodb", "mongoose", "orm", "data", "datastore", "nosql"]

@@ -6,4 +6,14 @@

var Query = require('mongoose/query');
var Query = require('mongoose/query')
, start = require('./common')
, mongoose = start.mongoose
, DocumentObjectId = mongoose.Types.ObjectId
, Schema = mongoose.Schema
var Product = new Schema({
tags: {} // mixed
});
mongoose.model('Product', Product);
/**

@@ -529,2 +539,14 @@ * Test.

'test casting an array set to mixed type works': function () {
var query = new Query();
var db = start();
var Product = db.model('Product');
var params = { _id: new DocumentObjectId, tags: { $in: [ 4, 8, 15, 16 ] }};
query.cast(Product, params);
params.tags.$in.should.eql([4,8,15,16]);
db.close();
},
// Advanced Query options

@@ -531,0 +553,0 @@

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