Registry / testing / mongo-eql

mongo-eql

JSON →
library1.0.0jsnpmunverified

mongo-eql (v1.0.0) implements MongoDB-style equality comparison for JavaScript data structures. It evaluates values using the same semantics as MongoDB's $eq operator, treating null and undefined as equal and performing deep equality on objects. The package is minimal, with no dependencies, and targets Node.js or browser environments. It is stable but no longer actively maintained (last release 2015), and offers a focused alternative to lodash.isEqual or deep-equal for MongoDB-like behavior.

npm install mongo-eql
INSTALL
IMPORT
SIG · MONGO-EQL
M
mongo-eql
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

eql
import eql from 'mongo-eql'
const eql = require('mongo-eql');
Default export only. ES module usage requires bundler or Node with 'type':'module'.
eql
const eql = require('mongo-eql');
const { eql } = require('mongo-eql');
CommonJS require returns a function directly, not an object.
eql
import * as mongoEql from 'mongo-eql';
import { default } from 'mongo-eql';
Namespace import works if default is not explicitly named.

Demonstrates MongoDB equality semantics including null/undefined equality and deep object comparison.

import eql from 'mongo-eql'; console.log(eql(null, undefined)); // true console.log(eql({ a: 1 }, { a: 1 })); // true console.log(eql([1, 2], [1, 3])); // false console.log(eql('hello', 'hello')); // true console.log(eql(1, '1')); // false (MongoDB strict type)
Debug
Known issues
gotchanull and undefined are treated as equal, which may surprise developers expecting strict equality.
fix
Use === if strict equality is needed.
affects: >=1.0
gotchaThe package does not support circular references; comparison may cause stack overflow.
fix
Avoid usage with circular data structures.
affects: >=1.0
gotchaReturns false for objects with identical content but different constructor or prototype chain.
fix
Use eql only for plain objects/arrays; for class instances consider custom comparison.
affects: >=1.0
Errors
Common errors & fixes
undefined is not a function
Using CommonJS destructuring require: const { eql } = require('mongo-eql')
fix
Use const eql = require('mongo-eql')
eql is not a function
Using ES module named import: import { eql } from 'mongo-eql'
fix
Use import eql from 'mongo-eql'
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
mongo-eql — npm install mongo-eql · libregistry