- Timestamp:
- 2024-02-26T00:44:26+13:00 (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/metadata-encoding/py/using-mongodb/mongoAnalysis.py
r38773 r38791 1 1 # function to display cool(?) statistics about the subtitle 2 2 3 import datetime 3 4 from dateutil.relativedelta import relativedelta … … 10 11 11 12 def main(): 13 # Connect to database 12 14 mClient = MongoClient("mongodb://localhost:27017/") 13 15 mDatabase = mClient["test"] 14 16 mCollection = mDatabase["crossref"] 15 17 16 getMinDateQuery = "asdas" 17 18 # Get minimum date 18 19 minimumDateQuery = mCollection.find().sort("dateCreated").limit(1) 20 # Get documents sorted by date 19 21 sortedCollectionQuery = mCollection.find().sort("dateCreated") 22 # And the count 20 23 countQuery = mCollection.estimated_document_count() 21 24 … … 53 56 #increase currentdate by a month 54 57 58 # currently unfinished. Need to finish the statistics insertion part of the method, and actually do something with that data. 59 55 60 main()
Note:
See TracChangeset
for help on using the changeset viewer.