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

mongodb-in-memory

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-in-memory - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

14

index.js

@@ -8,2 +8,6 @@ 'use strict';

var _assign = require('babel-runtime/core-js/object/assign');
var _assign2 = _interopRequireDefault(_assign);
var _regenerator = require('babel-runtime/regenerator');

@@ -104,3 +108,11 @@

_tcoll2.default.prototype.updateOne = _tcoll2.default.prototype.update;
_tcoll2.default.prototype.updateMany = _tcoll2.default.prototype.update;['nextObject', 'count', 'close', 'toArray'].forEach(function (methodName) {
_tcoll2.default.prototype.updateMany = _tcoll2.default.prototype.update;
_tcoll2.default.prototype.deleteOne = function (filter) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
options = (0, _assign2.default)({}, options, { single: true });
return _tcoll2.default.prototype.remove.call(this, filter, options);
};
_tcoll2.default.prototype.deleteMany = _tcoll2.default.prototype.remove;['nextObject', 'count', 'close', 'toArray'].forEach(function (methodName) {
_tcursor2.default.prototype[methodName] = _bluebird2.default.promisify(_tcursor2.default.prototype[methodName]);

@@ -107,0 +119,0 @@ });

2

package.json
{
"name": "mongodb-in-memory",
"version": "1.1.0",
"version": "1.2.0",
"scripts": {

@@ -5,0 +5,0 @@ "build": "babel -d . src/"

@@ -5,2 +5,6 @@ # mongodb-in-memory

This package is a thin wrapper around TingoDB.
It converts TingoDb's API to Promise API
and adds methods that you can find in the MongoDB Node.js package to the collection.
## Usage

@@ -12,2 +16,10 @@

const db = createDb()
demo()
async function demo () {
const users = db.collection('users')
const userId = (await users.insertOne({name: 'Jonas'})).insertedId
const user = await users.findOne({_id: userId})
await users.updateOne({_id: userId}, {$set: {name: 'Tom'}})
}
```

@@ -50,2 +50,8 @@ import tingodb from 'tingodb'

Collection.prototype.deleteOne = function (filter, options = {}) {
options = Object.assign({}, options, {single: true})
return Collection.prototype.remove.call(this, filter, options)
}
Collection.prototype.deleteMany = Collection.prototype.remove
;[

@@ -52,0 +58,0 @@ 'nextObject',

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