mongodb-proper-repository v0.1.1
mongodb-proper-repository
Unopionated and isomorphic MongoDB repository implementation, with JSON Schema validation, Extended JSON support, automatic relationship links and much more configurable features.
Features
Example: JSON Schema validation using AJV
prepareValidator: (repository) => {
const ajv = new Ajv(repository.schema, options);
const validate = ajv.compile(ajv);
return (object) => {
const isValid = validate(object);
if (!isValid) {
return validate.errors;
}
};
},
Example: JSON Schema transformation using RefParser
prepareSchema: async (repository) => {
return RefParser.$dereference(repository.schema)
}
Ending of mongodb-pro and mongodb-xcollection
From now on, I am archiving and deprecating these old GitHub repositories, since mongodb-proper-repository can be used as a proper replacement for them.
If you were using mongodb-pro to easily create and dispose connections, you can use the new static methods as replacements.
If you were using mongodb-xcollection to automatic EJSON serialization/deserialization, you can also use the new static methods passing ejson: true
as an option.
These old packages are also deprecated, which means that I will unpublish them from NPM, as their weekly downloads are too low.
I will not support these old packages anymore with new features or fixes.