Closed mikereiche closed 3 months ago
https://stackoverflow.com/questions/78838348/documentnotfounderror-in-the-findone-method-in-node-ottoman-couchbase-orm
https://ottomanjs.com/docs/basic/model
User.findOne({ name: 'Jane' }); // will return a document with a User with the name "Jane" or null in case of not finding it
https://github.com/couchbaselabs/node-ottoman/blob/4ceeda0dd62155831105cf10ed1938758980c177/src/model/create-model.ts#L247-L256
static findOne = async (filter: LogicalWhereExpr = {}, options: FindOptions = {}) => { const response = await find(metadata)(filter, { ...options, limit: 1, }); if (response?.rows?.length) { return response.rows[0]; } throw new DocumentNotFoundError(); };
+1
Duplicate of #783
https://stackoverflow.com/questions/78838348/documentnotfounderror-in-the-findone-method-in-node-ottoman-couchbase-orm
https://ottomanjs.com/docs/basic/model
https://github.com/couchbaselabs/node-ottoman/blob/4ceeda0dd62155831105cf10ed1938758980c177/src/model/create-model.ts#L247-L256