mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-05 16:10:11 +08:00
Add ReadPreference class
This commit is contained in:
Vendored
+10
@@ -134,6 +134,7 @@ declare module "mongodb" {
|
||||
}
|
||||
|
||||
// See : http://mongodb.github.io/node-mongodb-native/api-generated/db.html
|
||||
// Current definition by documentation version 1.3.13 (28.08.2013)
|
||||
export interface DBOptions {
|
||||
// the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = ‘majority’ or tag acknowledges the write.
|
||||
w?: string;
|
||||
@@ -147,6 +148,7 @@ declare module "mongodb" {
|
||||
// write waits for journal sync before returning. default:false.
|
||||
journal?: boolean;
|
||||
|
||||
// the prefered read preference. use 'ReadPreference' class.
|
||||
readPreference?: string;
|
||||
|
||||
// use c++ bson parser. default:false.
|
||||
@@ -183,6 +185,14 @@ declare module "mongodb" {
|
||||
promoteLongs?: boolean;
|
||||
}
|
||||
|
||||
export class ReadPreference {
|
||||
public static PRIMARY: string;
|
||||
public static PRIMARY_PREFERRED: string;
|
||||
public static SECONDARY: string;
|
||||
public static SECONDARY_PREFERRED: string;
|
||||
public static NEAREST: string;
|
||||
}
|
||||
|
||||
export interface CollectionCreateOptions {
|
||||
// {true | {w:n, wtimeout:n} | {fsync:true}, default:false}, executes with a getLastError command returning the results of the command on MongoDB.
|
||||
safe?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user