PHPackages                             jrschumacher/mongofunk - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. jrschumacher/mongofunk

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

jrschumacher/mongofunk
======================

Extends Mongo classes to better support various formats

07PHP

Since May 6Pushed 13y ago1 watchersCompare

[ Source](https://github.com/jrschumacher/mongofunk)[ Packagist](https://packagist.org/packages/jrschumacher/mongofunk)[ RSS](/packages/jrschumacher-mongofunk/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

MongoFunk
=========

[](#mongofunk)

[![Build Status](https://camo.githubusercontent.com/2917c471495e2fd89cdf6fe51c01a5b247325edb02abe5d83e8efea360115949/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6a72736368756d61636865722f6d6f6e676f66756e6b2e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/jrschumacher/mongofunk)

> Fixin' the funk out of Mongo classes.

Some of the Mongo classes act a little funky. This library intends to fix those.

MongoId
-------

[](#mongoid)

### Capitalization Funk

[](#capitalization-funk)

If you pass a capitalized string to MongoId it will store your string

```
$id = new MongoId("00000000000000000000AAAA");

var_dump($id);

/*
object (
  "$id" => "00000000000000000000AAAA"
)
*/

```

Now what happens if print it? Funk.

```
print $id; // 00000000000000000000aaaa

```

And what about comparing? Funk.

```
$id == 00000000000000000000AAAA // FALSE

```

#### Defunked

[](#defunked)

As soon as the string is passed we `strtolower` it. Defunked.

*Why don't you just output the passed format?* Well that has some issue with consistency in the database. This way I am hoping most of the bases are covered, but will need to do some further tests.

MongoDate
---------

[](#mongodate)

### DateTime Funk

[](#datetime-funk)

Per the documentation you need to pass an integer which represents a Unix timestamp or microtimestamp. This is understandable except DateTime is much more powerful and from the OO perspective a much better solution than timestamps.

#### Defunked

[](#defunked-1)

You can now pass DateTime objects to MongoDate.

```
$date = new DateTime();
$mdate = new MongoDate($date);
$date->getTimestamp() == $mdate->sec; // TRUE

```

You can also get a DateTime from MongoDate object

```
$mdate->getDateTime(); // returns DateTime instance

```

More
----

[](#more)

From my expierience that is the main frustrations, but more can be added.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba90fe3a7cb9b7037dc3b87ff1bf723612f4755c0653c0c531cdf8fd986521f5?d=identicon)[jrschumacher](/maintainers/jrschumacher)

---

Top Contributors

[![jrschumacher](https://avatars.githubusercontent.com/u/46549?v=4)](https://github.com/jrschumacher "jrschumacher (9 commits)")

### Embed Badge

![Health badge](/badges/jrschumacher-mongofunk/health.svg)

```
[![Health](https://phpackages.com/badges/jrschumacher-mongofunk/health.svg)](https://phpackages.com/packages/jrschumacher-mongofunk)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46143.1k6](/packages/jstewmc-rtf)[json-mapper/laravel-package

The JsonMapper package for Laravel

25188.9k3](/packages/json-mapper-laravel-package)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

112.9k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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