# @parameter1/mongodb-core

> A core MongoDB wrapper containing common utilities.

Latest version **3.6.0** (published 2025-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @parameter1/mongodb-core
pnpm add @parameter1/mongodb-core
yarn add @parameter1/mongodb-core
bun add @parameter1/mongodb-core
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.6.0 |
| Published | 2025-06-16 |
| First published | 2022-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=16.20.1 |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jacob Bare <jacob@parameter1.com> |
| Maintainers | zarathustra323, solocommand, brandonbk, b77mills |

## Links

- npm: https://www.npmjs.com/package/@parameter1/mongodb-core
- Repository: https://github.com/parameter1/mongodb
- Homepage: https://github.com/parameter1/mongodb/tree/main/packages/core#readme
- npm.io page: https://npm.io/package/@parameter1/mongodb-core

## Dependencies (1)

- [mongodb](https://npm.io/package/mongodb.md) ^6.17.0

## Recent versions

- 3.6.0 (latest) — 2025-06-16
- 3.5.0 — 2025-05-09
- 3.4.0 — 2024-11-19
- 3.3.0 — 2024-08-02
- 3.2.0 — 2024-01-18
- 3.1.0 — 2023-09-28
- 3.0.0 — 2023-08-31
- 2.3.0 — 2023-08-11
- 2.2.0 — 2023-06-12
- 2.1.0 — 2023-04-26
- 2.0.0 — 2023-03-24
- 1.4.0 — 2023-03-24
- 1.3.0 — 2022-12-21
- 1.2.0 — 2022-12-21
- 1.1.0 — 2022-11-19
- … 1 more at https://npm.io/package/@parameter1/mongodb-core/versions

## README

# MongoDB Core
A MongoDB wrapper containing core utilities.

## Installation
```
yarn add @parameter1/mongodb-core
```

## Usage
Core
```js
import { MongoClient } from '@parameter1/mongodb-core';

const client = new MongoClient('mongodb://some-server:27071');

client.connect().then(() => console.log('connected'));
```

Utilities
```js
import { filterMongoURL, iterateMongoCursor, MongoClient } from '@parameter1/mongodb-core';

// strips user names and passwords from mongo URLs
const client = new MongoClient('mongodb://user:password@some-server:27071');
// logs `mongodb://*****:*****@some-server:27071`
console.log(filterMongoURL(client));


// iterates over a mongo cursor
const cursor = await client.db('test').collection('foo').findMany({});

await iterateMongoCursor(cursor, async (doc) => {
  // do things here... can await
  await someThing(doc);
});

```

---
_Source: https://npm.io/package/@parameter1/mongodb-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
