mongodb-js / mongodb-schema

Infer a probabilistic schema for a MongoDB collection.

Home Page:https://github.com/mongodb-js/mongodb-schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

new optional parameter to limit the lengths collection

davidguiodo opened this issue · comments

Hi,

this works very fine on a mongodb with a big collection (600 000 items).
But the schema is very big just because of the "lengths" collection. My schema is 30 Mo and it could be just a few Ko if the "lengths" collection could be limited to 1000 / 2000 items with an option (the average would not be so precise in this case).

For example, the code in stream.js :
type.lengths.push(value.length);

could be something like :
if (type.lengths.length < MYOPTION) type.lengths.push(value.length);

Thanks for your work !