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

mongojs

Package Overview
Dependencies
Maintainers
4
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 2.2.2 to 2.3.0

10

lib/collection.js

@@ -144,2 +144,12 @@ var mongodb = require('mongodb')

Collection.prototype.rename = function (name, opts, cb) {
if (typeof opts === 'undefined') return this.rename(name, {}, noop)
if (typeof cb === 'undefined') return this.rename(name, noop)
this._getCollection(function (err, collection) {
if (err) return cb(err)
collection.rename(name, opts, cb)
})
}
Collection.prototype.drop = function (cb) {

@@ -146,0 +156,0 @@ this.runCommand('drop', cb)

6

package.json

@@ -9,3 +9,3 @@ {

],
"version": "2.2.2",
"version": "2.3.0",
"repository": "git://github.com/mafintosh/mongojs.git",

@@ -54,5 +54,5 @@ "author": "Mathias Buus Madsen <mathiasbuus@gmail.com>",

"coordinates": [
48.22875519999999,
16.3954423
48.2288574,
16.3957216
]
}
var test = require('./tape')
var mongojs = require('../index')
var db = mongojs('test', ['test.dot'])
var dbNoCollections = mongojs('test')
test('find in dot collection', function (t) {
db['test.dot'].drop(function () {
db['test.dot'].insert({ name: 'dot' }, function (err) {
var collection = db['test.dot']
testDropInsertAndFind(t, collection)
})
test('find in dot collection', function (t) {
var collection = dbNoCollections.collection('test.dot')
testDropInsertAndFind(t, collection)
})
function testDropInsertAndFind (t, collection) {
collection.drop(function () {
collection.insert({ name: 'dot' }, function (err) {
t.error(err)
db['test.dot'].findOne(function (err, doc) {
collection.findOne(function (err, doc) {
t.error(err)

@@ -16,2 +27,2 @@ t.equal(doc.name, 'dot')

})
})
}

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