Spaces:
Runtime error
Runtime error
Download static/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js from kaab4321/NarrativeFlow: direct link, hf CLI and curl.
- Browser
- Download file 619 Bytes
-
https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js
- Command line
-
hf download hf://spaces/kaab4321/NarrativeFlow/static/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js
-
curl -L -o applyReadConcern.js https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js
619 Bytes
| ; | |
| const get = require('../get'); | |
| module.exports = function applyReadConcern(schema, options) { | |
| if (options.readConcern !== undefined) { | |
| return; | |
| } | |
| // Don't apply default read concern to operations in transactions, | |
| // because you shouldn't set read concern on individual operations | |
| // within a transaction. | |
| // See: https://www.mongodb.com/docs/manual/reference/read-concern/ | |
| if (options && options.session && options.session.transaction) { | |
| return; | |
| } | |
| const level = get(schema, 'options.readConcern.level', null); | |
| if (level != null) { | |
| options.readConcern = { level }; | |
| } | |
| }; | |