rest-on-mongo (v2.4.0) is a Node.js package that provides a REST API layer over MongoDB, enabling direct CRUD operations via HTTP. It supports single or multiple databases with environment-based configuration, authentication via AUTH_TOKEN, read-only modes, and BSON data types. It offers a built-in Express server or library usage. Compared to alternatives, it supports bulk updates and multiple databases, but is REST-ish rather than pure REST. Release cadence is sporadic, with v2.0 introducing breaking changes in BSON handling.
npm install rest-on-mongoNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows two usage modes: quick standalone server via npx and library mode with custom Express server.
Manually convert strings to Date objects before sending. Use ISO 8601 strings.
Use explicit BSON serialization/deserialization in your application code.
Set PREFIXES, SERVER_<prefix>, DB_<prefix> env variables for multi-database mode.
Add rate limiting, HTTPS, and proper authentication middleware when exposing publicly.
Run npm install rest-on-mongo and ensure import path is correct.
Check SERVER env variable or mongo URI; ensure MongoDB is accessible.
Use import { Router } from 'rest-on-mongo' or const Router = require('rest-on-mongo').Router.