1.0.12 • Published 5 years ago

mongodb-index-inspector v1.0.12

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

MongoDB Index Inspector

Log warnings about the missing MongoDB indexes.

Support

MongoDB Node.JS Driver 2.2

MongoDB 3.4

Installation

npm install mongodb-index-inspector --save
npm install mongodb@2.2 --save

Usage

TypeScript

import { MongoDBIndexInspector, MongoDBFilter } from 'mongodb-index-inspector';

async function inspect (): void {
    const filter: MongoDBFilter = { username: 'davkorss', password: 'The safest password in the world :3' };
    const inspector: MongoDBIndexInspector = new MongoDBIndexInspector(collection);
    await inspector.inspect(filter);
}

inspect();
If the index does not exist, output should be:
'Missing index from filter {"username":"davkorss","password":"The safest password in the world :3"}'

JavaScript

const MongoDBIndexInspector = require('mongodb-index-inspector').MongoDBIndexInspector

async function inspect () {
    const filter = { username: 'davkorss', password: 'The safest password in the world :3' }
    const inspector = new MongoDBIndexInspector(collection)
    await inspector.inspect(filter)
}

inspect()
If the index does not exist, output should be:
'Missing index from filter {"username":"davkorss","password":"The safest password in the world :3"}'

Test

npm test
1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago