0.1.2 • Published 5 years ago

@splytech-io/mongodb-dynamic-indexes v0.1.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 years ago

MongoDB Dynamic Indexes

examples

import { DynamicIndexes } from '@splytech-io/mongodb-dynamic-indexes';

const collection = MongoDB.collection;
const di = new DynamicIndexes.Watcher(collection);

// - init
await di.loadIndexes();

// - add new index
const filter = {
  name: 'John',
  surname: 'Smith',
}
// create new dynamic index based on mongodb query
di.track(Object.keys(filter));
collection.findOne(filter).then(...);

// - cleanup
setInterval(() => {
  di.cleanup(/*milis: number*/); //removes unused dynamic indexes
}, 3600000);
1.0.0-alpha3

5 years ago

1.0.0-alpha2

5 years ago

1.0.0-alpha1

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago