@@ -1137,24 +1137,23 @@ Consider the following error in :program:`mongod` output and logs:
1137
1137
replSet error fatal couldn't query the local local.oplog.rs collection. Terminating mongod after 30 seconds.
1138
1138
<timestamp> [rsStart] bad replSet oplog entry?
1139
1139
1140
- The most often cause of this error is wrongly typed value for the
1141
- ``ts`` field in the last :term:`oplog` entry might be of the wrong
1142
- data type. The correct data type is Timestamp.
1140
+ Often, an incorrectly typed value in the ``ts`` field in the last
1141
+ :term:`oplog` entry causes this error. The correct data type is
1142
+ Timestamp.
1143
1143
1144
- You can check the data type by running the following two queries
1145
- against the oplog. If the data is properly typed, the queries will
1146
- return the same document, otherwise these queries will return
1147
- different documents. These queries are:
1144
+ Check the type of the ``ts`` value using the following two queries
1145
+ against the oplog collection:
1148
1146
1149
1147
.. code-block:: javascript
1150
1148
1149
+ db = db.getSiblingDB("local")
1151
1150
db.oplog.rs.find().sort({$natural:-1}).limit(1)
1152
1151
db.oplog.rs.find({ts:{$type:17}}).sort({$natural:-1}).limit(1)
1153
1152
1154
1153
The first query returns the last document in the oplog, while the
1155
1154
second returns the last document in the oplog where the ``ts`` value
1156
1155
is a Timestamp. The :operator:`$type` operator allows you to select
1157
- for type 17 ``BSON``, which is the Timestamp data type.
1156
+ :term:`BSON type` 17, is the Timestamp data type.
1158
1157
1159
1158
If the queries don't return the same document, then the last document in
1160
1159
the oplog has the wrong data type in the ``ts`` field.
0 commit comments