Registry / database / camo
library0.12.5jsnpmunverified

A class-based ES6 ODM (Object Document Mapper) for Mongo-like databases (currently supports MongoDB and NeDB). Current stable version is 0.12.5, last updated in 2019. The project has low release cadence and is mostly in maintenance mode. Key differentiators: it enforces ES6 classes for schema definition, supports multiple backends including the embedded NeDB (like SQLite for MongoDB), and uses native Promises. Alternatives: Mongoose (more popular and actively maintained) or NeDB directly. Not recommended for new projects due to lack of maintenance.

npm install camo
INSTALL
IMPORT
SIG · CAMO
C
camo
databasejavascriptv0.12.5
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.

connect
import { connect } from 'camo'
const connect = require('camo').connect
Use named import for ESM. CJS require is also possible but ESM is preferred.
Document
import { Document } from 'camo'
const Document = require('camo').Document
Base class for schema definitions. Must extend this class.
EmbeddedDocument
import { EmbeddedDocument } from 'camo'
import EmbeddedDocument from 'camo'
Named export, not default.

Shows connecting to a database, defining a Document subclass, creating/saving a document, and querying.

import { connect, Document } from 'camo'; // Define a document schema class User extends Document { constructor() { super(); this.name = String; this.age = Number; this.email = { type: String, unique: true }; } } async function main() { const db = await connect('mongodb://localhost:27017/mydb'); // Alternatively for NeDB: await connect('nedb://path/to/db'); const user = User.create({ name: 'Alice', age: 30, email: 'alice@example.com' }); await user.save(); console.log('User saved:', user._id); const users = await User.find({ age: { $gte: 18 } }); console.log('Users:', users); await db.close(); } main().catch(console.error);
Debug
Known issues
deprecatedProject is unmaintained since 2019. No updates for security or compatibility.
fix
Consider migrating to Mongoose or NeDB directly.
affects: >=0.12
gotchaNeDB backend is not thread-safe and not recommended for production.
fix
Use MongoDB backend for production.
affects: *
gotchaThe connect() function must be called before any document operations, but it's not enforced at type level.
fix
Always await connect() at the start of your application.
affects: *
breakingES6 classes require Node >= 4 and a transpiler for older environments.
fix
Use Node >= 4 or transpile with Babel.
affects: <0.12
Errors
Common errors & fixes
Error: Must call connect() before performing any operations
Database connection not established before document operations.
fix
Add await connect() before using any Document methods.
TypeError: Class extends value undefined is not a constructor or null
Failed to import Document properly (e.g., default import instead of named).
fix
Use import { Document } from 'camo'.
MongoError: Authentication failed
Invalid credentials provided to connect().
fix
Check username/password in connection string.
Upgrade
Version history
0.12.5latest on npm
Audit
Dependencies
nedboptionalRequired for embedded database backend
mongodboptionalRequired for MongoDB backend
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
camo — npm install camo · libregistry