{"id":42659,"library":"durable-objects-nosql","title":"durable-objects-nosql","description":"Provides a MongoDB-style NoSQL interface backed by Cloudflare Workers Durable Objects using SQLite storage. Version 0.0.1, early-stage. Differentiates by offering a familiar MongoDB-like API (find, insert, update, delete) for Durable Objects, simplifying state management in edge workers. Enables schema-less document storage with indexing support, leveraging Cloudflare's distributed execution model.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/drivly/ai","tags":["javascript","cloudflare","workers","durable-objects","nosql","mongodb","sqlite","typescript"],"install":[{"cmd":"npm install durable-objects-nosql","lang":"bash","label":"npm"},{"cmd":"yarn add durable-objects-nosql","lang":"bash","label":"yarn"},{"cmd":"pnpm add durable-objects-nosql","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export for the base class to extend your Durable Object from.","symbol":"DurableObjectNosql","correct":"import { DurableObjectNosql } from 'durable-objects-nosql'"},{"note":"The collection wrapper is named Collection, not MongoCollection.","wrong":"import { MongoCollection } from 'durable-objects-nosql'","symbol":"Collection","correct":"import { Collection } from 'durable-objects-nosql'"},{"note":"Helper to bootstrap a Durable Object endpoint; only for Workers environment.","symbol":"createServer","correct":"import { createServer } from 'durable-objects-nosql'"}],"quickstart":{"code":"import { DurableObjectNosql, Collection } from 'durable-objects-nosql';\n\ninterface User {\n  id: string;\n  name: string;\n  email: string;\n}\n\nclass UserStorage extends DurableObjectNosql {\n  async initialize() {\n    const users = new Collection<User>(this, 'users');\n    await users.createIndex({ email: 1 }, { unique: true });\n    await users.insertOne({ id: '1', name: 'Alice', email: 'alice@example.com' });\n    const result = await users.findOne({ email: 'alice@example.com' });\n    return result;\n  }\n}\n\nexport { UserStorage };\nexport default { fetch: (request: Request, env: Env) => { /* handle */ } };","lang":"typescript","description":"Shows how to define a Durable Object class with a MongoDB-like collection, create an index, insert and query a document."},"warnings":[{"fix":"Use a single Durable Object class per collection or implement custom routing.","message":"Durable Object storage is per-object; don't assume cross-object queries.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pin to exact version and review changelog before upgrades.","message":"Alpha version: API may change without notice.","severity":"breaking","affected_versions":"0.0.x"},{"fix":"Always await asynchronous operations to avoid undefined results.","message":"Methods like findOne return plain objects; they must be used with `await`.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Call createIndex in the class constructor or an init method called on first request.","message":"Index creation is asynchronous; ensure indexes are created before queries.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use `collection.updateMany({ filter }, { $set: {...} })` matching MongoDB syntax.","message":"The `updateMany` method signature changed; now requires filter and update object.","severity":"deprecated","affected_versions":"<=0.0.1"}],"env_vars":null,"search_vec":"'0.0.1':22 'api':34 'back':12 'cloudflar':14,58,64 'delet':38 'differenti':26 'distribut':60 'document':52 'durabl':2,16,40,67 'durable-object':66 'durable-objects-nosql':1 'earli':24 'early-stag':23 'edg':46 'enabl':48 'execut':61 'familiar':30 'find':35 'index':55 'insert':36 'interfac':11 'javascript':63 'less':51 'leverag':57 'like':33 'manag':44 'model':62 'mongodb':8,32,70 'mongodb-lik':31 'mongodb-styl':7 'nosql':4,10,69 'object':3,17,41,68 'offer':28 'provid':5 'schema':50 'schema-less':49 'simplifi':42 'sqlite':19,71 'stage':25 'state':43 'storag':20,53 'style':9 'support':56 'typescript':72 'updat':37 'use':18 'version':21 'worker':15,47,65","created_at":"2026-06-05T16:56:02.786726+00:00","updated_at":"2026-06-05T16:56:02.786726+00:00","problems":[{"fix":"Run `npm install durable-objects-nosql` and ensure import path is correct (no typo).","cause":"Package not installed or import path incorrect.","error":"Error: Cannot find module 'durable-objects-nosql'"},{"fix":"Ensure you import Collection as named export: `import { Collection } from 'durable-objects-nosql'`.","cause":"Collection may not have been instantiated correctly or import used wrongly.","error":"TypeError: collection.findOne is not a function"},{"fix":"Run code only inside a Cloudflare Worker with proper bindings.","cause":"Trying to use Durable Object methods outside of Cloudflare Workers environment.","error":"Error: Durable Object storage not available outside of Worker"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://mdx.org.ai","github":"https://github.com/drivly/ai","docs":null,"changelog":null,"pypi":null,"npm":"durable-objects-nosql","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-06-05","next_check":"2026-09-03","install_tag":null}}