🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
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

MongoDB compatible in-memory database for unit testing using TingoDB.

1.3.1
latest
npm
Version published
Weekly downloads
5
-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

mongodb-in-memory

MongoDB compatible in-memory database for unit testing using TingoDB.

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

import { createDb } from 'mongodb-in-memory'

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'}})
}

FAQs

Package last updated on 05 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts