You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/articles/AnIntroductionTo1_4_and_2_6.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -220,4 +220,11 @@ Buffered Max Entries allow for more fine grained control on how many operations
220
220
db.close();
221
221
});
222
222
223
-
This example disables the command buffering completely and errors out the moment there is no connection available. The default value (for backward compatibility) is to buffer until memory runs out. Be aware that by setting a very low value you can cause some problems in failover scenarios in Replicasets as it might take a little but of time before f.ex a new Primary is elected and steps up to accept writes. Setting **bufferMaxEntries** to 0 in this case will cause the driver to error out instead of falling over correctly.
223
+
This example disables the command buffering completely and errors out the moment there is no connection available. The default value (for backward compatibility) is to buffer until memory runs out. Be aware that by setting a very low value you can cause some problems in failover scenarios in Replicasets as it might take a little but of time before f.ex a new Primary is elected and steps up to accept writes. Setting **bufferMaxEntries** to 0 in this case will cause the driver to error out instead of falling over correctly.
224
+
225
+
## Fsync and journal Write Concerns note
226
+
227
+
MongoDB from version 2.6 and higher disallows the combination of **journal** and **fsync**. Combining them will cause an error while on 2.4 **fsync** was ignored when provided with **journal**. The following semantics apply.
228
+
229
+
* j: If true block until write operations have been committed to the journal. Cannot be used in combination with `fsync`. Prior to MongoDB 2.6 this option was ignored if the server was running without journaling. Starting with MongoDB 2.6 write operations will fail with an exception if this option is used when the server is running without journaling.
230
+
* fsync: If true and the server is running without journaling, blocks until the server has synced all data files to disk. If the server is running with journaling, this acts the same as the `j` option, blocking until write operations have been committed to the journal. Cannot be used in combination with `j`.
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
71
71
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
72
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
73
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
72
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
73
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
74
74
* - **continueOnError/keepGoing** {Boolean, default:false}, keep inserting documents even if one document has an error, *mongodb 1.9.1 >*.
75
75
* - **serializeFunctions** {Boolean, default:false}, serialize functions on the document.
76
76
* - **forceServerObjectId** {Boolean, default:false}, let server assign ObjectId instead of the driver
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
95
95
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
96
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
97
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
96
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
97
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
98
98
* - **single** {Boolean, default:false}, removes the first document found.
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
131
131
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
132
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
133
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
132
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
133
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
134
134
*
135
135
* Deprecated Options
136
136
* - **safe** {true | {w:n, wtimeout:n} | {fsync:true}, default:false}, executes with a getLastError command returning the results of the command on MongoDB.
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
151
151
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
152
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
153
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
152
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
153
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
154
154
* - **upsert** {Boolean, default:false}, perform an upsert operation.
155
155
* - **multi** {Boolean, default:false}, update all documents matching the selector.
156
156
* - **serializeFunctions** {Boolean, default:false}, serialize functions on the document.
@@ -216,8 +216,8 @@ Collection.prototype.drop = function drop(callback) {
216
216
* Options
217
217
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
218
218
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
219
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
220
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
219
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
220
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
221
221
* - **remove** {Boolean, default:false}, set to true to remove the object before returning.
222
222
* - **upsert** {Boolean, default:false}, perform an upsert operation.
223
223
* - **new** {Boolean, default:false}, set to true if you want to return the modified object rather than the original. Ignored for remove.
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
243
243
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
244
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
245
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
244
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
245
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
246
246
*
247
247
* Deprecated Options
248
248
* - **safe** {true | {w:n, wtimeout:n} | {fsync:true}, default:false}, executes with a getLastError command returning the results of the command on MongoDB.
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
354
354
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
355
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
356
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
355
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
356
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
357
357
* - **unique** {Boolean, default:false}, creates an unique index.
358
358
* - **sparse** {Boolean, default:false}, creates a sparse index.
359
359
* - **background** {Boolean, default:false}, creates the index in the background, yielding whenever possible.
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
383
383
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
384
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
385
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
384
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
385
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
386
386
* - **unique** {Boolean, default:false}, creates an unique index.
387
387
* - **sparse** {Boolean, default:false}, creates a sparse index.
388
388
* - **background** {Boolean, default:false}, creates the index in the background, yielding whenever possible.
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
623
623
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
624
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
625
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
624
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
625
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
626
626
*
627
627
* @param {Objects} [options] options for the initializeUnorderedBatch
628
628
* @param {Function} callback this will be called after executing this method. The first parameter will contain the Error object if an error occured, or null otherwise. The second argument will be a UnorderedBulkOperation object.
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
639
639
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
640
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
641
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
640
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
641
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
642
642
*
643
643
* @param {Objects} [options] options for the initializeOrderedBulkOp
644
644
* @param {Function} callback this will be called after executing this method. The first parameter will contain the Error object if an error occured, or null otherwise. The second argument will be a OrderedBulkOperation object.
Copy file name to clipboardExpand all lines: lib/mongodb/collection/batch/ordered.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,8 @@ var shared = require('../shared')
14
14
* Options
15
15
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
16
16
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
17
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
18
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
17
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
18
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
19
19
*
20
20
* @class Represents a OrderedBulkOperation
21
21
* @param {Object} collection collection instance.
@@ -476,8 +476,8 @@ function OrderedBulkOperation (collection, options) {
476
476
* Options
477
477
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
478
478
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
479
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
480
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
479
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
480
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
481
481
*
482
482
* @param {Object} [options] additional options during update.
483
483
* @param {Function} callback this will be called after executing this method. The first parameter will contain the Error object if an error occured, or null otherwise. While the second parameter will contain the results from from the ordered bulk operation.
Copy file name to clipboardExpand all lines: lib/mongodb/collection/batch/unordered.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,8 @@ var shared = require('../shared')
14
14
* Options
15
15
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
16
16
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
17
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
18
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
17
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
18
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
19
19
*
20
20
* @class Represents a UnorderedBulkOperation
21
21
* @param {Object} collection collection instance.
@@ -344,8 +344,8 @@ var UnorderedBulkOperation = function(collection, options) {
344
344
* Options
345
345
* - **w**, {Number/String, > -1 || 'majority' || tag name} the write concern for the operation where < 1 is no acknowlegement of write and w >= 1, w = 'majority' or tag acknowledges the write
346
346
* - **wtimeout**, {Number, 0} set the timeout for waiting for write concern to finish (combines with w option)
347
-
* - **fsync**, (Boolean, default:false) write waits for fsync before returning
348
-
* - **journal**, (Boolean, default:false) write waits for journal sync before returning
347
+
* - **fsync**, (Boolean, default:false) write waits for fsync before returning, from MongoDB 2.6 on, fsync cannot be combined with journal
348
+
* - **j**, (Boolean, default:false) write waits for journal sync before returning
349
349
*
350
350
* @param {Object} [options] additional options during update.
351
351
* @param {Function} callback this will be called after executing this method. The first parameter will contain the Error object if an error occured, or null otherwise. While the second parameter will contain the results from from the unordered bulk operation.
0 commit comments