PHPackages                             jcaillot/mongoid-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. jcaillot/mongoid-validator

AbandonedArchivedLibrary[Validation &amp; Sanitization](/categories/validation)

jcaillot/mongoid-validator
==========================

Symfony validator for mongoid string

v1.0(4y ago)110MITPHPPHP ^7.4 || ^8.0

Since Sep 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jcaillot/mongoid-validator)[ Packagist](https://packagist.org/packages/jcaillot/mongoid-validator)[ RSS](/packages/jcaillot-mongoid-validator/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

jcaillot/mongoid
================

[](#jcaillotmongoid)

### MongoId Symfony Validator

[](#mongoid-symfony-validator)

> checks if a string is a valid MongoId

requirements
------------

[](#requirements)

- Symfony &gt;=4
- PHP MongoDB PHP Driver

https://www.php.net/manual/en/set.mongodb.php

Installation
------------

[](#installation)

```
$composer require jcaillot/mongoid-validator
```

Usage
-----

[](#usage)

#### As Form Annotations

[](#as-form-annotations)

```
use Symfony\Component\Validator\Constraints as Assert;
use Chaman\Validator\Constraints as CustomAssert;

class Demo
{

/**
 * @var string
 *
 * @Assert\NotBlank
 * @CustomAssert\MongoId
 */
private string $mongoId;
```

#### in PHP code

[](#in-php-code)

```
use Symfony\Component\Validator\Validation;
use Chaman\Validator\Constraints\MongoId;

...
$validator = Validation::createValidator();
$constraint = new MongoId();
$id = '612e33884726a713fd31009b';

$violations = $validator->validate($id, $constraint);
if (!count($violations)) {
    ...
}
```

License
-------

[](#license)

This library is released under the [MIT license](https://github.com/rollerworks/PasswordStrengthBundle/blob/main/LICENSE).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1710d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55d128e145861bd2b84352101807005a5c1bca03fdced11b251c6c4e5855d102?d=identicon)[jcaillot](/maintainers/jcaillot)

---

Top Contributors

[![jcaillot](https://avatars.githubusercontent.com/u/22201753?v=4)](https://github.com/jcaillot "jcaillot (3 commits)")

---

Tags

symfonyvalidatormongo

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jcaillot-mongoid-validator/health.svg)

```
[![Health](https://phpackages.com/badges/jcaillot-mongoid-validator/health.svg)](https://phpackages.com/packages/jcaillot-mongoid-validator)
```

###  Alternatives

[rollerworks/password-strength-validator

Password-strength validator for Symfony

1455.7M6](/packages/rollerworks-password-strength-validator)[barbieswimcrew/zip-code-validator

Constraint class for international zipcode validation

772.3M](/packages/barbieswimcrew-zip-code-validator)[sllh/iso-codes-validator

Symfony validator wrapper of ronanguilloux/isocodes

37299.8k2](/packages/sllh-iso-codes-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
