{"id":25600,"library":"follicle","title":"Follicle","description":"Follicle is a class-based ES6 ODM (Object Document Mapper) for MongoDB and NeDB, forked from camo to support multiple concurrent database connections. Current version is 3.1.0 (stable, requires Node >=12). It provides a familiar OOP interface with ES6 classes, native Promises, and support for embedded documents, hooks, and counting. Unlike Mongoose, it offers a lighter-weight approach and supports NeDB as an alternative backend for development or in-memory usage. Release cadence is irregular; maintained by Seald.","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","es6","odm","mongodb","nedb","nosql","document","model","schema"],"install":[{"cmd":"npm install follicle","lang":"bash","label":"npm"},{"cmd":"yarn add follicle","lang":"bash","label":"yarn"},{"cmd":"pnpm add follicle","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Optional NeDB backend for development or in-memory storage","package":"@seald-io/nedb","optional":true},{"reason":"Optional MongoDB backend for production","package":"mongodb","optional":true}],"imports":[{"note":"ESM-only; CommonJS require is not supported for named exports.","wrong":"const connect = require('follicle').connect","symbol":"connect","correct":"import { connect } from 'follicle'"},{"note":"ESM-only; Document is a named export.","wrong":"const { Document } = require('follicle')","symbol":"Document","correct":"import { Document } from 'follicle'"},{"note":"Named export for defining embedded schemas.","wrong":"","symbol":"EmbeddedDocument","correct":"import { EmbeddedDocument } from 'follicle'"}],"quickstart":{"code":"import { connect, Document } from 'follicle';\n\n(async () => {\n  const database = await connect('mongodb://localhost:27017/mydb');\n\n  class User extends Document {\n    constructor() {\n      super();\n      this.name = '';\n      this.email = '';\n      this.age = 0;\n    }\n  }\n\n  const user = User.create({\n    name: 'Jane Doe',\n    email: 'jane@example.com',\n    age: 30\n  });\n  await user.save();\n\n  const users = await User.find({ age: { $gte: 18 } });\n  console.log(users);\n\n  await database.close();\n})().catch(console.error);","lang":"typescript","description":"Shows connecting to MongoDB, defining a document class, creating and saving a document, and querying with a filter."},"warnings":[{"fix":"Use import statements and set type: 'module' in package.json, or use dynamic import().","message":"The package is ESM-only since v3.0.0. Importing with require() will fail.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Run 'npm install @seald-io/nedb' for development or 'npm install mongodb' for production.","message":"You must install at least one backend driver (@seald-io/nedb or mongodb) or require it at runtime. Follicle will throw if no backend is available.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Migrate to MongoDB for production workloads.","message":"Using `connect()` with NeDB may have connection pool limitations compared to MongoDB; NeDB support is considered legacy.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'12':33 '3.1.0':29 'altern':67 'approach':61 'backend':68 'base':7 'cadenc':77 'camo':19 'class':6,42 'class-bas':5 'concurr':23 'connect':25 'count':52 'current':26 'databas':24 'develop':70 'document':11,49,89 'embed':48 'es6':8,41,84 'familiar':37 'follicl':1,2 'fork':17 'hook':50 'in-memori':72 'interfac':39 'irregular':79 'javascript':83 'lighter':59 'lighter-weight':58 'maintain':80 'mapper':12 'memori':74 'model':90 'mongodb':14,86 'mongoos':54 'multipl':22 'nativ':43 'nedb':16,64,87 'node':32 'nosql':88 'object':10 'odm':9,85 'offer':56 'oop':38 'promis':44 'provid':35 'releas':76 'requir':31 'schema':91 'seald':82 'stabl':30 'support':21,46,63 'unlik':53 'usag':75 'version':27 'weight':60","created_at":"2026-05-01T13:45:36.657842+00:00","updated_at":"2026-05-01T13:45:36.657842+00:00","problems":[{"fix":"Run 'npm install follicle --save' and ensure 'type': 'module' in package.json if using ESM.","cause":"Follicle is not installed or not resolved due to ESM configuration.","error":"Error: Cannot find module 'follicle'"},{"fix":"Replace require() with import { connect } from 'follicle'.","cause":"Using require() on an ESM-only export.","error":"TypeError: connect is not a function"},{"fix":"Install npm install @seald-io/nedb (for development) or npm install mongodb (for production).","cause":"Missing backend dependency.","error":"Error: No database backend found. Please install @seald-io/nedb or mongodb."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/follicle","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}