DEV Community

Eric Bishard
Eric Bishard

Posted on

Setting up Ottoman

Requirements: NodeJS/NPM, Docker, VS Code

  1. Setup the database:

    docker pull couchbase:7.0.0-beta
    docker run -d --name cb7 -p 8091-8096:8091-8096 -p 11210-11211:11210-11211 couchbase:7.0.0-beta

  2. Visit the locally running web admin at: localhost:8091

  3. Setup New Cluster with name & password

  4. Configure Disk, Memory, Services with at least: data, query, index services checked.

  5. Add a bucket named travel

With the database now up and running, let's clone a NodeJS project with some sample files we can use to learn Ottoman:

git clone https://github.com/httpJunkie/intro-to-ottoman-v2.git && cd intro-to-ottoman-v2 && npm install && code .
Enter fullscreen mode Exit fullscreen mode

This will clone the NodeJS project, change directories into the project, install dependencies, and now VS Code will now be open.

With this in place we should be able to run the individual files one at at time:

node createAirline.js
Enter fullscreen mode Exit fullscreen mode

This should add documents to your travel bucket. Next we can run:

node findAirline.js
node findWithQueryBuilder.js
Enter fullscreen mode Exit fullscreen mode

Now let's update that file:

node updateAirline.js
Enter fullscreen mode Exit fullscreen mode

You will notice a change in the document's callsign

This should give you a basic understanding of how to create an Ottoman project and get started!

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Postgres on Neon - Get the Free Plan

No credit card required. The database you love, on a serverless platform designed to help you build faster.

Get Postgres on Neon

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay