{"id":26818,"library":"camo","title":"Camo","description":"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.","status":"maintenance","version":"0.12.5","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/scottwrobinson/camo","tags":["javascript","es6","odm","mongodb","nedb","nosql","document","model","schema"],"install":[{"cmd":"npm install camo","lang":"bash","label":"npm"},{"cmd":"yarn add camo","lang":"bash","label":"yarn"},{"cmd":"pnpm add camo","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for embedded database backend","package":"nedb","optional":true},{"reason":"Required for MongoDB backend","package":"mongodb","optional":true}],"imports":[{"note":"Use named import for ESM. CJS require is also possible but ESM is preferred.","wrong":"const connect = require('camo').connect","symbol":"connect","correct":"import { connect } from 'camo'"},{"note":"Base class for schema definitions. Must extend this class.","wrong":"const Document = require('camo').Document","symbol":"Document","correct":"import { Document } from 'camo'"},{"note":"Named export, not default.","wrong":"import EmbeddedDocument from 'camo'","symbol":"EmbeddedDocument","correct":"import { EmbeddedDocument } from 'camo'"}],"quickstart":{"code":"import { connect, Document } from 'camo';\n\n// Define a document schema\nclass User extends Document {\n  constructor() {\n    super();\n    this.name = String;\n    this.age = Number;\n    this.email = { type: String, unique: true };\n  }\n}\n\nasync function main() {\n  const db = await connect('mongodb://localhost:27017/mydb');\n  // Alternatively for NeDB: await connect('nedb://path/to/db');\n\n  const user = User.create({ name: 'Alice', age: 30, email: 'alice@example.com' });\n  await user.save();\n  console.log('User saved:', user._id);\n\n  const users = await User.find({ age: { $gte: 18 } });\n  console.log('Users:', users);\n\n  await db.close();\n}\n\nmain().catch(console.error);","lang":"javascript","description":"Shows connecting to a database, defining a Document subclass, creating/saving a document, and querying."},"warnings":[{"fix":"Consider migrating to Mongoose or NeDB directly.","message":"Project is unmaintained since 2019. No updates for security or compatibility.","severity":"deprecated","affected_versions":">=0.12"},{"fix":"Use MongoDB backend for production.","message":"NeDB backend is not thread-safe and not recommended for production.","severity":"gotcha","affected_versions":"*"},{"fix":"Always await connect() at the start of your application.","message":"The connect() function must be called before any document operations, but it's not enforced at type level.","severity":"gotcha","affected_versions":"*"},{"fix":"Use Node >= 4 or transpile with Babel.","message":"ES6 classes require Node >= 4 and a transpiler for older environments.","severity":"breaking","affected_versions":"<0.12"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add await connect() before using any Document methods.","cause":"Database connection not established before document operations.","error":"Error: Must call connect() before performing any operations"},{"fix":"Use import { Document } from 'camo'.","cause":"Failed to import Document properly (e.g., default import instead of named).","error":"TypeError: Class extends value undefined is not a constructor or null"},{"fix":"Check username/password in connection string.","cause":"Invalid credentials provided to connect().","error":"MongoError: Authentication failed"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}