12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 'use strict';
- class ReadConcern {
-
- constructor(level) {
- if (level != null) {
- this.level = level;
- }
- }
-
- static fromOptions(options) {
- if (options == null) {
- return;
- }
- if (options.readConcern) {
- if (options.readConcern instanceof ReadConcern) {
- return options.readConcern;
- }
- return new ReadConcern(options.readConcern.level);
- }
- if (options.level) {
- return new ReadConcern(options.level);
- }
- }
- static get MAJORITY() {
- return 'majority';
- }
- static get AVAILABLE() {
- return 'available';
- }
- static get LINEARIZABLE() {
- return 'linearizable';
- }
- static get SNAPSHOT() {
- return 'snapshot';
- }
- }
- module.exports = ReadConcern;
|