Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 781 Bytes

notes.md

File metadata and controls

27 lines (20 loc) · 781 Bytes
  1. add lname field for case insensite match, index
  2. add timestamp for lastupdate
from datetime import datetime
 c.test.test.insert({'db_added': datetime.utcnow()})
  1. add "gtm or ltm" to _id e.g. {"_id": "type:gtm /Common/blah"}

  2. figure out current db issues

  • mongoshell: db.stats() -> returns db stats db.getCollecctionsName() -> returns all collections db.getCollection('colection_name').stats() -> returns stats about a collection
The .find() method takes additional keyword arguments. One of them is
no_cursor_timeout which you need to set to True

cursor = collection.find({}, no_cursor_timeout=True) You don't need to write
your own generator function. The find() method returns a generator like object.

for c in cursor:
  print(c)