What does the “h” in oplog.rs document stand for?

2020-06-17 06:52发布

问题:

As in here:

{
    "ts" : Timestamp(1374832131, 1),
    "h" : NumberLong("-1336944105039123379"),
    "v" : 2,
    "op" : "i",
    "ns" : "users.users",
    "o" : {
            "_id" : ObjectId("51f24603d98de3716b1db672")
    }
}

Thanks

回答1:

  1. ts: the time this operation occurred.
  2. h: a unique ID for this operation. Each operation will have a different value in this field.
  3. op: the write operation that should be applied to the slave. n indicates a no-op, this is just an informational message.
  4. ns: the database and collection affected by this operation. Since this is a no-op, this field is left blank.
  5. o: the actual document representing the op. Since this is a no-op, this field is pretty useless.

Reference: Replication Internals



标签: mongodb