Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document not found #747

Closed
pullmann4rent opened this issue Dec 22, 2023 · 1 comment
Closed

Document not found #747

pullmann4rent opened this issue Dec 22, 2023 · 1 comment
Labels

Comments

@pullmann4rent
Copy link

pullmann4rent commented Dec 22, 2023

Hello,

Why I recieve document not found ?

import express from 'express';
import { cbdb } from './config/db';
import { Ottoman, Schema } from 'ottoman';

const app = express();

const ottoman = new Ottoman({scopeName: 'sf_scope', modelKey: 'type'});

await ottoman.connect({
  connectionString: 'couchbases://cb.4lcmapxglzylh11p.cloud.couchbase.com',
  bucketName: 'sf_bucket',
  username: 'xxxx',
  password: 'xxxx'
});

await ottoman.start();

const ProductsSchema = new Schema({
  click: String
});

const Products = ottoman.model('users', ProductsSchema);

app.get('/', async(req, res) => {
  try {
    console.time("concatenation");
    
    const products = await Products.findById('123');

    console.log(products);
    
    console.timeEnd("concatenation");

    res.send('hello');
  } catch(e) {
    console.log(e);
    res.send(e);
  }
})

const port = process.env.PORT || 3000;
const server = app.listen(port, async () => {
  console.log(`server started on port: ${port}`);
});

fd

@mikereiche
Copy link

mikereiche commented Dec 22, 2023

user error. Please make an effort to troubleshoot your code before filing a ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants