Mongo Help

Also, I stored a lot of class notes, if you know where to look for them. In preparation for the 2nd certification for mongodb, I am writing some stuff up. My stuff will always be free. In time will contain how to do javascript functions in mongo client (you would put in on the server), bash functions, setup replica set, setup a two replica set shard, populate a dummy document quickly, add/remove/change indexes, aggregate function.... Mongo

Unless otherwise noted, this will in general be for 3.4, with 3.6 notes.


Mongo in the cloud


Mongo links
Mongo questions:
ClassStatusDue date
M001: MongoDB Basics DONE
M034: New Features and Tools in MongoDB 3.4 DONENov 07SAVE
M101P: MongoDB for Developers Dec 12th REDO (time)
M102: MongoDB for DBAs DONEDec 5thNOTE each page. waiting for confirmation.
M121: The MongoDB Aggregation Framework StartnigDec 19th Make doc notes.
M123: Getting Started with MongoDB Atlas StartingDEc 12thEverything due at end.
M201: MongoDB Performance DONE Nov 7th SAVE. Review all.
M310: MongoDB Security Nov 7th REDO (time)
M312: Diagnostics and Debugging week 3Dec 19th Make Doc Notes.

Here are annoying questions I've been asked in interviews. Annoying because most of the time you only use this info during interviews and never in the real world. It also to get them to show they are superior.
  1. ops manager --- why? who cares. Its cool, its nice, it is great and you
  should learn ops manager, but a real DBA should't need it and should be
  able to do things manually. Some would argue time, I am for ability first.
  OPS Manager is great, but easy as hell. No great ability.
  2. command to see if upgrade can happen: db.upgradeCheckAllDBs() or db.upgradeCheck().
    Who cares. If you follow the steps for upgrade, you will do this.
    In addition, this was only for 2.6. 
  3. compass --- its nice and recommend using it. But a real DBA doesn't need it.
  4. Atlas -- same thing.  

  5. Mongo Isolation levels -- who cares. Mongo releases locks between connections
  for inconsistent results anyways. 
  
     Two aggreage functions with write locks or shared locks run, what happens.
     https://docs.mongodb.com/v3.4/faq/concurrency/

     https://docs.mongodb.com/v3.4/core/write-operations-atomicity/

    Run A write test, 2 queries, updating date which should take 10 seconds.
    1st starts at beignning, 2nd starts 90% of way through, then does the rest.
    Count them after.

  6. How can you configure HA for 3 servers and 2 data centers. you can't
     and an arbiter (still one of the 3) doesn't help. The person was thinking
     of https://docs.mongodb.com/manual/core/replica-set-architecture-geographically-distributed/
     but you can't have HA with two data centers and one goes down. 

  7. What happens specifically, between journaling, writing to the ops logs,
     and if a system crashes. Well the journaling will help the ops log
     be consistent before the crash. But this is why who cares. Its just a
     a way for junior DBA to show he/she is superior when they are not.
     Mongo is ONLY one document at a time atomic. It is not atomic at the
     collection level with locks and stuff. Crashes are helped by journaling
     to keep ops logs consistent with the data. Read more about journaling.
     You never need to know the specifics in the real world.

  8. Have you installed ssl, Kerberos, ldap, etc. Who cares, this is easy
     and most people don't use them. A lot don't even use passwords.

  9. updateMany() --- why is this useless? Its an alias for update with the
     multi option. New in 3.2. 
     
  
Legitimate questions