New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mongo-sanity

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongo-sanity

`mongo-sanity` is a library designed to validate MongoDB documents against a predefined schema. It ensures that the documents stored in your MongoDB collections adhere to the specified structure and constraints.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

mongo-sanity

mongo-sanity is a library designed to validate MongoDB documents against a predefined schema. It ensures that the documents stored in your MongoDB collections adhere to the specified structure and constraints.

Features

  • Schema Validation: Validate MongoDB documents against a predefined schema.
  • Custom Validators: Define custom validation rules for specific fields.
  • Error Reporting: Detailed error messages for validation failures.
  • Flexible Schema Definitions: Support for various data types and nested schemas.

Installation

To install the library, use npm or yarn:

npm install mongo-sanity

Usage

import mongoose from 'mongoose';
import { connectToDatabaseAndValidateData } from 'mongo-sanity';

// Model initialization

await connectToDatabaseAndValidateData(mongoose);

FAQs

Package last updated on 24 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts