# ottoman

> Ottoman Couchbase ODM

Latest version **2.5.8** (published 2026-07-09) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install ottoman
pnpm add ottoman
yarn add ottoman
bun add ottoman
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.5.8 |
| Published | 2026-07-09 |
| First published | 2013-12-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 5 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 295 |
| Maintainers | couchbase-bot, brett19, ejscribner_cb, thejcfactor, gmming |
| Keywords | couchbase, odm, nosql, json, document, model, schema, database |

## Links

- npm: https://www.npmjs.com/package/ottoman
- Repository: https://github.com/couchbaselabs/node-ottoman
- Homepage: https://github.com/couchbaselabs/node-ottoman#readme
- Issues: https://github.com/couchbaselabs/node-ottoman/issues
- npm.io page: https://npm.io/package/ottoman

## Dependencies (5)

- [uuid](https://npm.io/package/uuid.md) 11.1.1
- [lodash](https://npm.io/package/lodash.md) 4.18.1
- [jsonpath](https://npm.io/package/jsonpath.md) 1.3.0
- [couchbase](https://npm.io/package/couchbase.md) 4.7.1
- [@scarf/scarf](https://npm.io/package/@scarf/scarf.md) 1.4.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.5.8 (latest) — 2026-07-09
- 2.0.0-alpha.15 (alpha) — 2021-02-02
- 2.5.7 — 2026-06-24
- 2.5.6 — 2026-04-07
- 2.5.5 — 2026-03-04
- 2.5.4 — 2026-02-23
- 2.5.3 — 2025-10-20
- 2.5.2 — 2025-05-16
- 2.5.1 — 2024-11-23
- 2.5.0 — 2024-06-10
- 2.4.0 — 2024-01-24
- 2.3.4 — 2023-08-01
- 2.3.3 — 2023-04-04
- 2.3.2 — 2023-03-02
- 2.3.1 — 2023-03-02
- … 56 more at https://npm.io/package/ottoman/versions

## README

![CI](https://github.com/couchbaselabs/node-ottoman/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/couchbaselabs/node-ottoman/branch/master/graph/badge.svg)](https://codecov.io/gh/couchbaselabs/node-ottoman)
[![npm version](https://badge.fury.io/js/ottoman.svg)](https://badge.fury.io/js/ottoman)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

# Introduction

Ottoman is an ODM built for Couchbase and Node.js.

Ottoman's goal is to provide a better development experience while using Couchbase,
bringing to developers a reliable tool to build systems that are easy to design, maintain, and scale.

## Installation

```
npm install ottoman
```

That's it, you are ready to use Ottoman.

### Dependencies Matrix

Supported version are:

| Ottoman | Nodejs  | Couchbase SDK | Couchbase Server |
|---------|---------|---------------|------------------|
| ^2.3.0  | ^12.0.0 | ^4.4.6        | ^7.2.0           |

***Notice: make sure you are using supported versions***

## Getting started

```javascript
const { connect, model, start, close } = require('ottoman');

const main = async () => {
  await connect("couchbase://localhost/travel-sample@admin:password");

  const User = model('User', { name: String });

  const user = new User({ name: 'Jane Doe' });

  await start();

  await user.save();
  console.log('Nice Job!');

  await close();
}

main();
```

You should see results similar to the following:

```
Nice Job!
```

> [!NOTE]
> If you are using the legacy version of Ottoman, check out the [V1 docs](https://v1.ottomanjs.com/).


## Ottoman v2 main goals

- To add support to Couchbase SDK 3.x and above
- To add typescript support.
- To have a powerful query builder built-in.
- To allow adding indexes to improve queries performance.
- To have extendable Schemas using statics, methods, hooks.
- To have Pluggable Schemas.

## Documentation

Check out our [examples](https://ottomanjs.com/docs/first-app) and [docs](https://ottomanjs.com/docs/quick-start) for typescript and javascript implementation.

## Questions

For questions and support please use [the official forum](https://forums.couchbase.com/) or [contact community](http://couchbase.com/communities/nodejs).
Please make sure to read the [Issue Reporting Checklist](https://github.com/couchbaselabs/node-ottoman/issues) before opening an issue.

## Changelog

Detailed changes for each release are documented in the [release notes](https://docs.couchbase.com/nodejs-sdk/current/project-docs/ottoman-release-notes.html).

## Stay In Touch

- [Blog](https://blog.couchbase.com/?s=ottoman)

## Contributions

Thank you to all the people who already contributed to Couchbase Ottoman!

### Guide for Developers

1. [Install Couchbase Server Using Docker](https://docs.couchbase.com/server/current/install/getting-started-docker.html).

> [!TIP]
> Check results on [http://localhost:8091/](http://localhost:8091/) couchbase web client.


2. Get the repo and install dependencies

```
$ git clone https://github.com/couchbaselabs/node-ottoman.git
$ cd node-ottoman
$ yarn install
```

3. Available scripts

```
$ yarn dev
$ yarn build
$ yarn lint
$ yarn test
$ yarn test --coverage
$ yarn docs
$ yarn docs:dev
```

## Deploying Ottoman to NPM

- Pull master branch from repo
- yarn install
- ensure version number is bumped
- yarn build
- yarn is:ready

## Publishing to NPM

When publishing a new package to NPM, please follow the following steps:

- git pull (master branch)
- update the `package.json` file w/ new version
- yarn install && yarn build
- yarn test:legacy (Use `test:legacy` Until CB 7 Release)
- yarn pack (ensure package is packing as intended)
- npm publish (--tag alpha or --tag beta)
- push changes to `package.json` file w/ new version
- deploy docs *if required

Once package is published, *update the docs:

- yarn docs:dev (preview site)
- yarn docs (generate docs directory)
- copy files in `docs/.vuepress/dist` to ottomanjs-site
- ensure CNAME file is correct
- git push changes to ottomanjs-site

## License

© Copyright 2021 Couchbase Inc.

Licensed under the Apache License, Version 2.0.
See [the Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0).

---
_Source: https://npm.io/package/ottoman · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
