Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

applyWriteConcern.js 472B

12345678910111213141516
  1. 'use strict';
  2. const get = require('../get');
  3. module.exports = function applyWriteConcern(schema, options) {
  4. const writeConcern = get(schema, 'options.writeConcern', {});
  5. if (!('w' in options) && writeConcern.w != null) {
  6. options.w = writeConcern.w;
  7. }
  8. if (!('j' in options) && writeConcern.j != null) {
  9. options.j = writeConcern.j;
  10. }
  11. if (!('wtimeout' in options) && writeConcern.wtimeout != null) {
  12. options.wtimeout = writeConcern.wtimeout;
  13. }
  14. };