Open lemanschik opened 5 days ago
console.log(1)
await connect("couchbase://localhostdefault-bucket@appasa:appappasdasd",{ });
console.log(2)
const User = model('User', { name: String },{
collectionName: "_default",scopeName: "_default"
});
console.log(3)
const user = new User({ name: 'Jane Doe' });
console.log(4,user)
await start(); // This should throw if something like collection and scope not exists
console.log(5)
await user.save();
console.log(6)
console.log('Nice Job!');
await close();
Main Issues
Need to create apis and refactor to esm asap this week.
References
Copy from old issue
add helpers
Ottoman accepts scopeName and collectionName while model accepts only scopeName
Disable All exports of the cjs module i mark this a case for migration to esm only as require('es-module') lands in node 22.x
Notes
https://ottomanjs.com/docs/basic/ottoman#defining-an-ottoman-instance mainly the example to use collections
https://github.com/couchbaselabs/node-ottoman/issues/639#issuecomment-1061010070