@types/mongoose-id-validator
TypeScript icon, indicating that this package has built-in type declarations

0.6.6 • Public • Published

Installation

npm install --save @types/mongoose-id-validator

Summary

This package contains type definitions for mongoose-id-validator (https://github.com/CampbellSoftwareSolutions/mongoose-id-validator).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongoose-id-validator.

index.d.ts

import { Connection, Schema } from "mongoose";

interface MongooseIdValidatorOptions {
    /* Optional, custom validation message with {PATH} being replaced
     * with the relevant schema path that contains an invalid
     * document ID.
     */
    message?: string | undefined;

    /* Optional, mongoose connection object to use if you are
     * using multiple connections in your application.
     *
     * Defaults to built-in mongoose connection if not specified.
     */
    connection?: Connection | undefined;

    /* Optional, applies to validation of arrays of ID references only. Set
     * to true if you sometimes have the same object ID reference
     * repeated in an array. If set, the validator will use the
     * total of unique ID references instead of total number of array
     * entries when checking the database.
     *
     * Defaults to false
     */
    allowDuplicates?: boolean | undefined;
}

declare function mongooseIdValidator(schema: Schema, options?: MongooseIdValidatorOptions): void;

export = mongooseIdValidator;

Additional Details

Credits

These definitions were written by Kerollos Magdy.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/mongoose-id-validator

Weekly Downloads

206

Version

0.6.6

License

MIT

Unpacked Size

4.93 kB

Total Files

5

Last publish

Collaborators

  • types