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

mongojs

Package Overview
Dependencies
Maintainers
2
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongojs - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

22

index.js

@@ -6,16 +6,10 @@ var mongo = require('mongodb');

var normalizeId = function() {
var createObjectId = function() {
if (!mongo.BSONNative || !mongo.BSONNative.ObjectID) {
return function(args) {
if (args[0] && typeof args[0] === 'object' && typeof args[0]._id === 'string') {
args[0]._id = mongo.BSONPure.ObjectID.createFromHexString(args[0]._id);
}
return args;
return function(id) {
return mongo.BSONPure.ObjectID.createFromHexString(id);
};
}
return function(args) {
if (args[0] && typeof args[0] === 'object' && typeof args[0]._id === 'string') {
args[0]._id = new mongo.BSONNative.ObjectID(args[0]._id);
}
return args;
return function(id) {
return new mongo.BSONNative.ObjectID(id);
};

@@ -91,3 +85,3 @@ }();

Collection.prototype.find = function() {
var args = normalizeId(Array.prototype.slice.call(arguments));
var args = Array.prototype.slice.call(arguments);
var oncursor = common.future();

@@ -139,3 +133,2 @@ var oncollection = this._oncollection;

Collection.prototype._exec = function(name, args) {
var args = normalizeId(args);
var callback = typeof args[args.length-1] === 'function' ? args[args.length-1] : noop;

@@ -156,2 +149,4 @@

exports.ObjectId = createObjectId;
exports.connect = function(url, collections) {

@@ -196,2 +191,3 @@ url = parse(url);

that.ObjectId = createObjectId;
that.collection = function(name) {

@@ -198,0 +194,0 @@ var oncollection = common.future();

@@ -5,3 +5,3 @@ {

"keywords": ["mongo", "db", "mongodb"],
"version":"0.2.4",
"version":"0.2.5",
"homepage" : "https://github.com/gett/mongojs",

@@ -8,0 +8,0 @@ "author": "Ge.tt <hello@ge.tt>",

@@ -5,3 +5,3 @@ # mongojs

npm install mongojs --mongodb:native
npm install mongojs

@@ -46,2 +46,2 @@ mongojs is very simple to use:

For more detailed information about the different usages of update and quering see [the mongo docs](http://www.mongodb.org/display/DOCS/Manual)
For more detailed information about the different usages of update and quering see [the mongo docs](http://www.mongodb.org/display/DOCS/Manual)
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