I have tried Ottomann but I get document not found error, why ?
const ottoman = new Ottoman({scopeName: 'sf_scope'});
await ottoman.connect({
connectionString: 'couchbases://cbxxxxcmxxxx',
bucketName: 'sf_bucket',
username: 'xxxx',
password: 'xxxx'
});
await ottoman.start();
const ProductsSchema = new Schema({
click: String
});
const Products = ottoman.model('products', ProductsSchema);
app.get('/', async(req, res) => {
try {
console.time("concatenation");
const products = await Products.findById('product1')
console.log(products);
console.timeEnd("concatenation");
res.send('hello');
} catch(e) {
console.log(e);
res.send(e);
}
})
Error:
[DocumentNotFoundError: document not found] {
cause: [Error: document_not_found (101)] {
ctxtype: 'key_value',
code: 101,
id: 'products::product1',
opaque: 12,
cas: Cas<0>,
status_code: 1,
enhanced_error_info: undefined,
last_dispatched_to: '192.168.0.20:56666',
last_dispatched_from: '3.249.44.37:11207',
retry_attempts: 0,
retry_reasons: []
},