# @types/mongoose-id-validator

> TypeScript definitions for mongoose-id-validator

Latest version **0.6.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/mongoose-id-validator
pnpm add @types/mongoose-id-validator
yarn add @types/mongoose-id-validator
bun add @types/mongoose-id-validator
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.6.6 |
| Published | 2023-11-07 |
| First published | 2020-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51434 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/mongoose-id-validator
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongoose-id-validator
- npm.io page: https://npm.io/package/@types/mongoose-id-validator

## Dependencies (2)

- [mongoose](https://npm.io/package/mongoose.md) ^6.3.0
- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 0.6.6 (latest) — 2023-11-07
- 0.6.3 (ts4.1) — 2022-04-24
- 0.6.2 (ts3.6) — 2021-07-08
- 0.6.0 (ts3.2) — 2020-09-29
- 0.6.5 — 2023-10-18
- 0.6.4 — 2023-09-27
- 0.6.1 — 2021-06-01

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongoose-id-validator/index.d.ts)
````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
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [mongoose](https://npmjs.com/package/mongoose)

# Credits
These definitions were written by [Kerollos Magdy](https://github.com/kerolloz).

---
_Source: https://npm.io/package/@types/mongoose-id-validator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
