title: What do the oplog fields actually mean?
body: <p>I've seen this question posed before, but the answers were very vague. I have been doing some research on oplog, and am trying to understand exactly how it works. In particular, I want to have a good understanding of the fields in an oplog document and what data they store. </p>
  
  <p>These are the fields I have found through tests and what I <em>think</em> they mean as well as what I am still unsure of: </p>
  
  <ul>
  <li>ts: timestamp of the write operation / oplog entry</li>
  <li>h: a unique identifier for the oplog entry (but why is it sometimes positive and sometimes negative?)</li>
  <li>op: type of operation performed (usually i/u/d for insert, update or delete) </li>
  <li>ns: database &amp; collection affected</li>
  <li>o: the new state of the document after performing the change</li>
  <li>o2: Seems to contain the _id field of the document during an update operation. Why is this needed when that same field is present as part of the o field, which also contains the rest of the document? </li>
  <li>b: Seems to be a bool that appears for delete operations. What is the significance of this field? </li>
  </ul>
  
  <p>I would like to confirm whether or not the points I made above are accurate, as well as clarifications for the bits that aren't clear. I am also interested to know if there any other fields that can appear in an oplog document. </p>