8000 GitHub - mongodb-js/ns: MongoDB namespace string (db.collection) parsing and validation · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Nov 6, 2026. It is now read-only.
mongodb-jsPublic archive

About

MongoDB namespace string (db.collection) parsing and validation

Topics

Resources

Stars

2 stars

Watchers

12 watching

Forks

Repository files navigation

Warning

This repository is archived. Package was moved to mongodb-js/devtools-shared

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 }

license

MIT

About

MongoDB namespace string (db.collection) parsing and validation

Topics

Resources

Stars

2 stars

Watchers

12 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0