# mongodb-ns

> MongoDB namespace parsing and validation

Latest version **3.2.6** (published 2026-09-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install mongodb-ns
pnpm add mongodb-ns
yarn add mongodb-ns
bun add mongodb-ns
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.2.6 |
| Published | 2026-09-15 |
| First published | 2014-04-21 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 21.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 24 |
| Author | MongoDB Inc |
| Maintainers | satyasinha, kristina.stefano, jarjee, devtoolsbot, mongo-j, nbbeeken, dbx-node, devtools-npm-user, imlucas, mongodb-js-user |

## Links

- npm: https://www.npmjs.com/package/mongodb-ns
- Repository: https://github.com/mongodb-js/devtools-shared
- Issues: https://jira.mongodb.org/projects/COMPASS/issues
- npm.io page: https://npm.io/package/mongodb-ns

## Recent versions

- 3.2.6 (latest) — 2026-09-15
- 3.2.5 — 2026-09-09
- 3.2.4 — 2026-09-09
- 3.2.3 — 2026-09-07
- 3.2.2 — 2026-09-07
- 3.2.1 — 2026-07-24
- 3.2.0 — 2026-05-05
- 3.1.11 — 2026-05-03
- 3.1.10 — 2026-05-01
- 3.1.9 — 2026-04-23
- 3.1.8 — 2026-04-16
- 3.1.7 — 2026-03-27
- 3.1.6 — 2026-02-11
- 3.1.5 — 2026-01-19
- 3.1.4 — 2025-12-17
- … 21 more at https://npm.io/package/mongodb-ns/versions

## README

# mongodb-ns

Handle dem namespaces like the kernel do.

```
var ns = require('mongodb-ns');

var bacon = ns('canadian-things.songs-aboot-bacon');
console.log(bacon.toString() + '\n', bacon);
```

will output

```
canadian-things.songs-aboot-bacon
 NS {
  ns: 'canadian-things.songs-aboot-bacon',
  dotIndex: 15,
  database: 'canadian-things',
  collection: 'songs-aboot-bacon',
  system: false,
  oplog: false,
  command: false,
  special: false,
  specialish: false,
  normal: true,
  validDatabaseName: true,
  validCollectionName: true,
  databaseHash: 23620443216 }
```

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