File tree Expand file tree Collapse file tree 5 files changed +38
-0
lines changed Expand file tree Collapse file tree 5 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ func Linearizable() *ReadConcern {
40
40
return New (Level ("linearizable" ))
41
41
}
42
42
43
+ // Available specifies that the query should return data from the instance with no guarantee
44
+ // that the data has been written to a majority of the replica set members (i.e. may be rolled back).
45
+ func Available () * ReadConcern {
46
+ return New (Level ("available" ))
47
+ }
48
+
43
49
// New constructs a new read concern from the given string.
44
50
func New (options ... Option ) * ReadConcern {
45
51
concern := & ReadConcern {}
Original file line number Diff line number Diff line change 24
24
"readConcern" : {
25
25
"level" : " majority"
26
26
}
27
+ },
28
+ {
29
+ "description" : " available specified" ,
30
+ "uri" : " mongodb://localhost/?readConcernLevel=available" ,
31
+ "valid" : true ,
32
+ "warning" : false ,
33
+ "readConcern" : {
34
+ "level" : " available"
35
+ }
27
36
}
28
37
]
29
38
}
Original file line number Diff line number Diff line change 17
17
valid : true
18
18
warning : false
19
19
readConcern : { level: "majority" }
20
+ -
21
+ description : " available specified"
22
+ uri : " mongodb://localhost?readConcernLevel=available"
23
+ valid : true
24
+ warning : false
25
+ readConcern : { level: "available" }
Original file line number Diff line number Diff line change 28
28
"level" : " local"
29
29
},
30
30
"isServerDefault" : false
31
+ },
32
+ {
33
+ "description" : " Available" ,
34
+ "valid" : true ,
35
+ "readConcern" : {
36
+ "level" : " available"
37
+ },
38
+ "readConcernDocument" : {
39
+ "level" : " available"
40
+ },
41
+ "isServerDefault" : false
31
42
}
32
43
]
33
44
}
Original file line number Diff line number Diff line change @@ -16,4 +16,10 @@ tests:
16
16
valid : true
17
17
readConcern : { level: "local" }
18
18
readConcernDocument : { level: "local" }
19
+ isServerDefault : false
20
+ -
21
+ description : " Available"
22
+ valid : true
23
+ readConcern : { level: "available" }
24
+ readConcernDocument : { level: "available" }
19
25
isServerDefault : false
You can’t perform that action at this time.
0 commit comments