# Learn Python Series (#19) - PyMongo Part 2  #### What Will I Learn? - You will learn the remainder of the basic CRUD operations in MongoDB (`update_one()`, `update_many()`, `replace_once()`, `delete_one()`); - about some useful Query Operators; - and hopefully understand the Query Operator syntax as well; - and as a result you can pinpoint and "slice" more specific queries for data retrieval, document updating and deletion. #### Requirements - A working modern computer running macOS, Windows or Ubuntu - An installed Python 3(.6) distribution, such as (for example) the Anaconda Distribution - The ambition to learn Python programming #### Difficulty Intermediate #### Curriculum (of the `Learn Python Series`): - [Learn Python Series - Intro](https://utopian.io/utopian-io/@scipio/learn-python-series-intro) - [Learn Python Series (#2) - Handling Strings Part 1](https://utopian.io/utopian-io/@scipio/learn-python-series-2-handling-strings-part-1) - [Learn Python Series (#3) - Handling Strings Part 2](https://utopian.io/utopian-io/@scipio/learn-python-series-3-handling-strings-part-2) - [Learn Python Series (#4) - Round-Up #1](https://utopian.io/utopian-io/@scipio/learn-python-series-4-round-up-1) - [Learn Python Series (#5) - Handling Lists Part 1](https://utopian.io/utopian-io/@scipio/learn-python-series-5-handling-lists-part-1) - [Learn Python Series (#6) - Handling Lists Part 2](https://utopian.io/utopian-io/@scipio/learn-python-series-6-handling-lists-part-2) - [Learn Python Series (#7) - Handling Dictionaries](https://utopian.io/utopian-io/@scipio/learn-python-series-7-handling-dictionaries) - [Learn Python Series (#8) - Handling Tuples](https://utopian.io/utopian-io/@scipio/learn-python-series-8-handling-tuples) - [Learn Python Series (#9) - Using Import](https://utopian.io/utopian-io/@scipio/learn-python-series-9-using-import) - [Learn Python Series (#10) - Matplotlib Part 1](https://utopian.io/utopian-io/@scipio/learn-python-series-10-matplotlib-part-1) - [Learn Python Series (#11) - NumPy Part 1](https://utopian.io/utopian-io/@scipio/learn-python-series-11-numpy-part-1) - [Learn Python Series (#12) - Handling Files](https://utopian.io/utopian-io/@scipio/learn-python-series-12-handling-files) - [Learn Python Series (#13) - Mini Project - Developing a Web Crawler Part 1](https://utopian.io/utopian-io/@scipio/learn-python-series-13-mini-project-developing-a-web-crawler-part-1) - [Learn Python Series (#14) - Mini Project - Developing a Web Crawler Part 2](https://utopian.io/utopian-io/@scipio/learn-python-series-14-mini-project-developing-a-web-crawler-part-2) - [Learn Python Series (#15) - Handling JSON](https://utopian.io/utopian-io/@scipio/learn-python-series-15-handling-json) - [Learn Python Series (#16) - Mini Project - Developing a Web Crawler Part 3](https://utopian.io/utopian-io/@scipio/learn-python-series-16-mini-project-developing-a-web-crawler-part-3) - [Learn Python Series (#17) - Roundup #2 - Combining and analyzing any-to-any multi-currency historical data](https://utopian.io/utopian-io/@scipio/learn-python-series-17-roundup-2-combining-and-analyzing-any-to-any-multi-currency-historical-data) - [Learn Python Series (#18) - PyMongo Part 1](https://utopian.io/utopian-io/@scipio/learn-python-series-18-pymongo-part-1) # Learn Python Series (#19) - PyMongo Part 2 In the previous `Learn Python Series` episode about `PyMongo Part 1`, we learned - in essence - the difference between SQL and NoSQL databases, and we learned how to setup and interact with MongoDB via Python's PyMongo iwth respect to inserting one or more documents to a collection, finding one or more documents stored in a collection, based on a certain - or empty - search query, and we learned how to count the number of those documents found. In this episde, we'll expand our knowledge regarding PyMongo with a number of techniques. Let's get started! # Updating one document using `update_one()` and the `$set` update operator As a brief reminder, and/or for the people "jumping in" on this `PyMongo Part 2` episode, let's first import pymongo again, establish the connection, assign the database and collection, and take it from there: ```python import pymongo # Importing the pretty print module, # you don't have to, it just formats better # for readability on Utopian.io / Steemit.com from pprint import pprint client = pymongo.MongoClient('mongodb://localhost:27017') db = client.test_mongo coll = db.accounts ``` Let's first print the current state the `scipio` document is in, so we clearly know which effect updating it wil have: ```python scipio = coll.find_one({"account": "scipio"}) # print() instead of pprint() works just fine as well pprint(scipio) ``` {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'slogan': "Does it matter who's right, or who's left?"} Now, when looking at https://steemd.com/@scipio I see my Steem Id is `422033` so let's add that to the `scipio` account document, by updating it with `update_one()`: ```python result = coll.update_one( {"account": "scipio"}, {"$set": {"account_id": 422033}} ) scipio = coll.find_one({"account": "scipio"}) print('Updated Scipio document: {}'.format(scipio)) ``` Updated Scipio document: {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'slogan': "Does it matter who's right, or who's left?", 'account_id': 422033} **Nota bene 1:** the `update_one()` method first expects a key:value pair argument to find the target document (to be updated) with, then it expects the update query as a second argument. **Nota bene 2:** the `$set` operator creates the field `"account_id"` if it doesn't exist yet, otherwise it updates it. # Updating multiple documents using `update_many()` Suppose we want to update all (currently: 4) documents in the `accounts` collection with the key:value pair `{"active": True}`. The `update_many()` method is perfectly suited to do that. It works as follows: ```python result = coll.update_many({}, {"$set": {"active": True}}) all_accounts = coll.find() for each_account in all_accounts: pprint(each_account) ``` {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'account_id': 422033, 'active': True, 'slogan': "Does it matter who's right, or who's left?"} {'_id': ObjectId('5ae46693dd58330cd6660570'), 'account': 'stoodkev', 'active': True} {'_id': ObjectId('5ae46693dd58330cd6660571'), 'account': 'fabiyamada', 'account_id': 261379, 'active': True} {'_id': ObjectId('5ae46693dd58330cd6660572'), 'account': 'jedigeiss', 'active': True, 'slogan': 'IT Nerd, Risk Specialist, Musician, Cryptocoin Enthusiast, Banker, ' 'Gamer'} # Updating a single document by replacing its content using `replace_one()` Now let's again have a look at the `jedigeiss` account. Being German, @jedigeiss without a doubt is a huge fan of Matthias Reim's song "Verdammt ich lieb dich" (published in 1994), so let's change his slogan using `replace_once()` like so: ```python # PS: pymongo (relatively) recently changed the location of # the objectid class from pymongo to bson. # If you want to query using ObjectIds, import this as well: from bson.objectid import ObjectId new_slogan = "Verdammt ich lieb dich, Ich lieb dich nicht." result = coll.replace_one({'_id': ObjectId('5ae46693dd58330cd6660572')}, {"slogan": new_slogan}) jedigeiss = coll.find_one({'_id': ObjectId('5ae46693dd58330cd6660572')}) print(jedigeiss) ``` {'_id': ObjectId('5ae46693dd58330cd6660572'), 'slogan': 'Verdammt ich lieb dich, Ich lieb dich nicht.'} **Hmmmm...** the "slogan" value did change to the famous Matthias Rein song, but now the "account" and "active" fields (key:value pairs) are gone! This is of course not a bug but a feature of the `replace_one()` method: as opposed to the `update_one()` method that leaves the "other" document fields in tact, the `replace_one()` method **replaces** the entire document data with the data passed to it as an argument. Please keep this in mind when using `replace_one()`! # Deleting a single document with `delete_one()` Since the accounts document previously containing the data from @jedigeiss now only contains an ObjectId and a slogan from Matthias Rein, we might as well delete that document alltogether. We can do this, like so: ```python result = coll.delete_one({'_id': ObjectId('5ae46693dd58330cd6660572')}) num_accounts = coll.find().count() print(num_accounts) ``` 3 And as a result, our `accounts` collection now consists of only 3 accounts. But... this tutorial episode cannot continue before bringing back my friend and fellow Utopian Advisor @jedigeiss to the database, so let's do so via: ```python jedigeiss = { 'account': 'jedigeiss', 'active': True, 'slogan': 'IT Nerd, Risk Specialist, Musician, Cryptocoin Enthusiast, Banker, ' 'Gamer' } result = coll.insert_one(jedigeiss) ``` ```python all_accounts = coll.find() for each_account in all_accounts: pprint(each_account) ``` {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'account_id': 422033, 'active': True, 'slogan': "Does it matter who's right, or who's left?"} {'_id': ObjectId('5ae46693dd58330cd6660570'), 'account': 'stoodkev', 'active': True} {'_id': ObjectId('5ae46693dd58330cd6660571'), 'account': 'fabiyamada', 'account_id': 261379, 'active': True} {'_id': ObjectId('5ae4bc73dd58332709589486'), 'account': 'jedigeiss', 'active': True, 'slogan': 'IT Nerd, Risk Specialist, Musician, Cryptocoin Enthusiast, Banker, ' 'Gamer'} ... better! ### Recap: What have we learned thus far regarding PyMongo? We can now do so-called basic **CRUD operations** using PyMongo: - C (Create): `insert_one()`, `insert_many()` - R (Read): `find_one()`, `find_many()` - U (Update): `update_one()`, `update_many()`, `replace_one()` - D (Delete): `delete_one()` # Using Query Operators Up until now, we've been using very simple queries, either none (to find or update all documents in the collection) or so specific that only one document was found (either by `"account": name` or by ObjectId). But one of the big advantages of MongoDB is its ability to use **Query Operators**, allowing you to define more complex queries for finding, updating and/or deleting documents or fields. Let's review a few well-known and useful Query Operators. ### `$exists` `$exists` matches documents containing / having **a specific field**, for example the `"slogan"` field, like so: ```python result = coll.find({"slogan": {"$exists": True}}) for account in result: pprint(account) ``` {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'account_id': 422033, 'active': True, 'slogan': "Does it matter who's right, or who's left?"} {'_id': ObjectId('5ae4bc73dd58332709589486'), 'account': 'jedigeiss', 'active': True, 'slogan': 'IT Nerd, Risk Specialist, Musician, Cryptocoin Enthusiast, Banker, ' 'Gamer'} or, the other way around, to find all accounts documents **not** having the `"slogan"` field in them: ```python result = coll.find({"slogan": {"$exists": False}}) for account in result: pprint(account) ``` {'_id': ObjectId('5ae46693dd58330cd6660570'), 'account': 'stoodkev', 'active': True} {'_id': ObjectId('5ae46693dd58330cd6660571'), 'account': 'fabiyamada', 'account_id': 261379, 'active': True} ### `$gt` and `$gte`, `$lt` and `$lte` `$gt` matches values greater than ( > ) a specified value, `$gte` matches values greater than or equal to ( >= ) a specified value: ```python result = coll.find({"account_id": {"$gt": 261379}}) for account in result: pprint(account) ``` {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'account_id': 422033, 'active': True, 'slogan': "Does it matter who's right, or who's left?"} ```python result = coll.find({"account_id": {"$gte": 261379}}) for account in result: pprint(account) ``` {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'account_id': 422033, 'active': True, 'slogan': "Does it matter who's right, or who's left?"} {'_id': ObjectId('5ae46693dd58330cd6660571'), 'account': 'fabiyamada', 'account_id': 261379, 'active': True} `$lt` matches values smaller than ( < ) a specified value, `$lte` matches values smaller than or equal to ( <= ) a specified value: ```python result = coll.find({"account_id": {"$lt": 422033}}) for account in result: pprint(account) ``` {'_id': ObjectId('5ae46693dd58330cd6660571'), 'account': 'fabiyamada', 'account_id': 261379, 'active': True} ```python result = coll.find({"account_id": {"$lte": 422033}}) for account in result: pprint(account) ``` {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'account_id': 422033, 'active': True, 'slogan': "Does it matter who's right, or who's left?"} {'_id': ObjectId('5ae46693dd58330cd6660571'), 'account': 'fabiyamada', 'account_id': 261379, 'active': True} ### `$ne` `$ne` matches documents that are **not equal** to a specified value. Please note that if documents don't contain a specific field at all, that the `$ne` Query Operator matches those non-existent field-documents as well! ```python result = coll.find({"account_id": {"$ne": 123456}}) for account in result: pprint(account) ``` {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'account_id': 422033, 'active': True, 'slogan': "Does it matter who's right, or who's left?"} {'_id': ObjectId('5ae46693dd58330cd6660570'), 'account': 'stoodkev', 'active': True} {'_id': ObjectId('5ae46693dd58330cd6660571'), 'account': 'fabiyamada', 'account_id': 261379, 'active': True} {'_id': ObjectId('5ae4bc73dd58332709589486'), 'account': 'jedigeiss', 'active': True, 'slogan': 'IT Nerd, Risk Specialist, Musician, Cryptocoin Enthusiast, Banker, ' 'Gamer'} ### `$in` and `$nin` The `$in` operator allows for passing in a list (array) of values and it then matches any documents containing values specified in the list (array). ```python result = coll.find({"account": {"$in": ["stoodkev","scipio", "jedigeiss"]}}) for account in result: pprint(account) ``` {'_id': ObjectId('5ae46285dd58330cd666056f'), 'account': 'scipio', 'account_id': 422033, 'active': True, 'slogan': "Does it matter who's right, or who's left?"} {'_id': ObjectId('5ae46693dd58330cd6660570'), 'account': 'stoodkev', 'active': True} {'_id': ObjectId('5ae4bc73dd58332709589486'), 'account': 'jedigeiss', 'active': True, 'slogan': 'IT Nerd, Risk Specialist, Musician, Cryptocoin Enthusiast, Banker, ' 'Gamer'} The `$nin` operator does the opposite: it matches any documents **not** specified in the list (array). ```python result = coll.find({"account": {"$nin": ["stoodkev","scipio", "jedigeiss"]}}) for account in result: pprint(account) ``` {'_id': ObjectId('5ae46693dd58330cd6660571'), 'account': 'fabiyamada', 'account_id': 261379, 'active': True} # What did we learn, hopefully? In this episode, we expanded on our gathered knowledge regarding PyMongo by completing the basic CRUD (Create, Read, Update, Delete) operations, by reviewing the methods `update_one()`, `update_many()`, `replace_one()`, and `delete_one()`. We then looked at a few common so-called "Query Operators" with which we can make somewhat more complex queries in order to find, update or delete documents based. ### Thank you for your time! <br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@scipio/learn-python-series-19-pymongo-part-2">Utopian.io - Rewarding Open Source Contributors</a></em><hr/>
author | scipio | ||||||
---|---|---|---|---|---|---|---|
permlink | learn-python-series-19-pymongo-part-2 | ||||||
category | utopian-io | ||||||
json_metadata | "{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":81598961,"name":"cpython","full_name":"python/cpython","html_url":"https://github.com/python/cpython","fork":false,"owner":{"login":"python"}},"pullRequests":[],"platform":"github","type":"tutorials","tags":["utopian-io","steemdev","steemstem","open-source","python"],"users":["jedigeiss"],"links":["https://utopian.io/utopian-io/@scipio/learn-python-series-intro","https://utopian.io/utopian-io/@scipio/learn-python-series-2-handling-strings-part-1","https://utopian.io/utopian-io/@scipio/learn-python-series-3-handling-strings-part-2","https://utopian.io/utopian-io/@scipio/learn-python-series-4-round-up-1","https://utopian.io/utopian-io/@scipio/learn-python-series-5-handling-lists-part-1","https://utopian.io/utopian-io/@scipio/learn-python-series-6-handling-lists-part-2","https://utopian.io/utopian-io/@scipio/learn-python-series-7-handling-dictionaries","https://utopian.io/utopian-io/@scipio/learn-python-series-8-handling-tuples","https://utopian.io/utopian-io/@scipio/learn-python-series-9-using-import","https://utopian.io/utopian-io/@scipio/learn-python-series-10-matplotlib-part-1","https://utopian.io/utopian-io/@scipio/learn-python-series-11-numpy-part-1","https://utopian.io/utopian-io/@scipio/learn-python-series-12-handling-files","https://utopian.io/utopian-io/@scipio/learn-python-series-13-mini-project-developing-a-web-crawler-part-1","https://utopian.io/utopian-io/@scipio/learn-python-series-14-mini-project-developing-a-web-crawler-part-2","https://utopian.io/utopian-io/@scipio/learn-python-series-15-handling-json","https://utopian.io/utopian-io/@scipio/learn-python-series-16-mini-project-developing-a-web-crawler-part-3","https://utopian.io/utopian-io/@scipio/learn-python-series-17-roundup-2-combining-and-analyzing-any-to-any-multi-currency-historical-data","https://utopian.io/utopian-io/@scipio/learn-python-series-18-pymongo-part-1","https://steemd.com/@scipio","https://utopian.io/utopian-io/@scipio/learn-python-series-19-pymongo-part-2"],"image":["https://cdn.utopian.io/posts/cec1aefe48d5e4ab867572c5230f49626693python_logo.png"],"moderator":{"account":"roj","time":"2018-04-28T21:37:21.789Z","pending":false,"reviewed":true,"flagged":false},"questions":null,"score":null,"total_influence":null,"staff_pick":null,"staff_pick_by":null,"config":{"questions":[{"question":"How many substantial concepts does this tutorial address?","question_id":"tuts-1","answers":[{"answer":"4-5 substantial concepts covered in the tutorial.","answer_id":"tuts-1-a-1","value":10},{"answer":"2-3 substantial concepts covered in the tutorial.","answer_id":"tuts-1-a-2","value":7},{"answer":"1 substantial concept covered in the tutorial.","answer_id":"tuts-1-a-3","value":3},{"answer":"More than 5 substantial concepts covered in the tutorial.","answer_id":"tuts-1-a-4","value":0}]},{"question":"Does the title and the outline of the tutorial properly reflect the content?","question_id":"tuts-2","answers":[{"answer":"Yes, it is very clear.","answer_id":"tuts-2-a-1","value":15},{"answer":"To some extent.","answer_id":"tuts-2-a-2","value":11.5},{"answer":"The title is somewhat misleading and/or the outline is not detailed or informative enough.","answer_id":"tuts-2-a-3","value":4.5},{"answer":"Title and outline are of little or no relevance to the content of the tutorial.","answer_id":"tuts-2-a-4","value":0}]},{"question":"Did the contributor provide supplementary resources, such as code and sample files in the contribution post or a linked GitHub repository?","question_id":"tuts-3","answers":[{"answer":"Yes, exceptional supplementary resources are provided including a relevant github repo/gist.","answer_id":"tuts-3-a-1","value":15},{"answer":"Supplementary resources provided are of high relevance.","answer_id":"tuts-3-a-2","value":12},{"answer":"Contributor provides minimal supplementary resources.","answer_id":"tuts-3-a-3","value":6},{"answer":"No supplementary resources were provided.","answer_id":"tuts-3-a-4","value":0}]},{"question":"Is the tutorial part of a series?","question_id":"tuts-4","answers":[{"answer":"Yes.","answer_id":"tuts-4-a-1","value":10},{"answer":"Yes, but it is the first entry in the series.","answer_id":"tuts-4-a-2","value":7},{"answer":"No, but it works just fine as a stand-alone tutorial.","answer_id":"tuts-4-a-3","value":5},{"answer":"No.","answer_id":"tuts-4-a-4","value":0}]},{"question":"Does the tutorial contain sufficient explanatory visuals?","question_id":"tuts-5","answers":[{"answer":"Yes, the visual components of the post were adequate in quality and quantity.","answer_id":"tuts-5-a-1","value":10},{"answer":"The volume of visual components included was unnecessarily large.","answer_id":"tuts-5-a-2","value":7},{"answer":"The post lacked sufficient visualization to easily learn from the content.","answer_id":"tuts-5-a-3","value":3},{"answer":"No visualization was presented in this contribution.","answer_id":"tuts-5-a-4","value":0}]},{"question":"How unique and/or innovative are the concepts covered in the tutorial?","question_id":"tuts-6","answers":[{"answer":"This was the first time I read about the concepts covered.","answer_id":"tuts-6-a-1","value":10},{"answer":"The concepts covered were innovative and offer some usefulness.","answer_id":"tuts-6-a-2","value":7},{"answer":"I have read several similar ideas and thoughts elsewhere, but this one was of higher quality.","answer_id":"tuts-6-a-3","value":5},{"answer":"Such tutorials can be found online with great ease and the contribution add no value to the open source community.","answer_id":"tuts-6-a-4","value":0}]},{"question":"How would you describe the formatting, language and overall presentation of the post?","question_id":"c-1","answers":[{"answer":"The post is of very high quality.","answer_id":"c-1-a-1","value":10},{"answer":"The post is of decent quality, but not spectacular in any way.","answer_id":"c-1-a-2","value":7},{"answer":"The post is poorly written and/or formatted, but readable.","answer_id":"c-1-a-3","value":3},{"answer":"The post is really hard to read and the content is barely understandable.","answer_id":"c-1-a-4","value":0}]},{"question":"How would you rate the overall value of this contribution on the open source community and ecosystem?","question_id":"c-2","answers":[{"answer":"This contribution brings great and impactful value, and can be used for applications outside the specific project.","answer_id":"c-2-a-1","value":20},{"answer":"This contribution adds significant value to the open source community and ecosystem, or is of critical importance to the specific project.","answer_id":"c-2-a-2","value":16},{"answer":"This contribution adds some value to the open source community and ecosystem or is only valuable to the specific project.","answer_id":"c-2-a-3","value":8},{"answer":"This contribution adds no value to the open source community and ecosystem or the specific project.","answer_id":"c-2-a-4","value":0}]}]}}" | ||||||
created | 2018-04-28 19:48:21 | ||||||
last_update | 2018-04-28 21:37:21 | ||||||
depth | 0 | ||||||
children | 13 | ||||||
last_payout | 2018-05-05 19:48:21 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 78.066 HBD | ||||||
curator_payout_value | 27.011 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 16,192 | ||||||
author_reputation | 34,229,826,851,736 | ||||||
root_title | "Learn Python Series (#19) - PyMongo Part 2" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 52,700,858 | ||||||
net_rshares | 18,743,744,658,861 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
pharesim | 0 | 75,879,791,937 | 0.02% | ||
lafona-miner | 0 | 140,325,200,983 | 5% | ||
kushed | 0 | 18,073,413,677 | 0.89% | ||
drifter1 | 0 | 7,801,329,608 | 100% | ||
leprechaun | 0 | 11,979,046,593 | 100% | ||
justtryme90 | 0 | 119,304,631,444 | 5% | ||
anwenbaumeister | 0 | 24,647,481,836 | 0.89% | ||
liberosist | 0 | 5,778,243,738 | 0.97% | ||
rjbauer85 | 0 | 278,172,761 | 5% | ||
anarchyhasnogods | 0 | 8,502,328,803 | 2.5% | ||
lamouthe | 0 | 1,304,334,145 | 5% | ||
meerkat | 0 | 50,174,359,846 | 0.97% | ||
curie | 0 | 46,832,030,257 | 0.89% | ||
hendrikdegrote | 0 | 516,027,101,501 | 0.89% | ||
steemstem | 0 | 125,269,700,291 | 5% | ||
foundation | 0 | 621,806,895 | 5% | ||
the-devil | 0 | 589,705,690 | 5% | ||
thevenusproject | 0 | 2,509,069,981 | 5% | ||
dna-replication | 0 | 1,402,184,464 | 5% | ||
erikaflynn | 0 | 39,574,432,558 | 100% | ||
borislavzlatanov | 0 | 386,575,523 | 5% | ||
jamhuery | 0 | 499,952,606 | 5% | ||
kryzsec | 0 | 1,259,881,916 | 5% | ||
nedspeaks | 0 | 963,889,674 | 5% | ||
fredrikaa | 0 | 11,264,360,949 | 2.5% | ||
diogogomes | 0 | 312,195,276 | 85% | ||
helo | 0 | 26,667,630,875 | 100% | ||
locikll | 0 | 423,472,786 | 1.78% | ||
dber | 0 | 1,626,460,544 | 5% | ||
kerriknox | 0 | 11,210,885,275 | 5% | ||
blessing97 | 0 | 169,787,337 | 5% | ||
tensor | 0 | 21,710,054,417 | 100% | ||
ertwro | 0 | 1,861,502,786 | 5% | ||
juanjdiaz89 | 0 | 162,900,604 | 5% | ||
nitesh9 | 0 | 1,126,524,284 | 5% | ||
howo | 0 | 161,703,096,985 | 100% | ||
himal | 0 | 346,906,445 | 5% | ||
abigail-dantes | 0 | 85,246,325,204 | 5% | ||
leczy | 0 | 265,800,843 | 5% | ||
suravsingh | 0 | 59,426,047 | 5% | ||
jasonbu | 0 | 17,550,811,516 | 50% | ||
akeelsingh | 0 | 188,192,590 | 5% | ||
pearlumie | 0 | 1,966,703,135 | 5% | ||
parejan | 0 | 33,946,759,436 | 100% | ||
jedigeiss | 0 | 647,838,192,091 | 100% | ||
danielfinn | 0 | 367,427,404 | 100% | ||
ksenij | 0 | 84,838,423 | 100% | ||
julienbh | 0 | 20,408,498,026 | 100% | ||
loshcat | 0 | 2,911,550,573 | 100% | ||
geniusloci | 0 | 16,032,566,500 | 100% | ||
steemline | 0 | 228,587,016 | 100% | ||
carloserp-2000 | 0 | 855,233,611 | 5% | ||
pangoli | 0 | 390,287,601 | 5% | ||
rachelsmantra | 0 | 193,103,174 | 5% | ||
faisalamin | 0 | 5,658,953,718 | 100% | ||
gra | 0 | 1,696,362,380 | 5% | ||
utopian-io | 0 | 16,324,015,769,134 | 10.95% | ||
chireerocks | 0 | 1,033,622,269 | 12% | ||
rdvn | 0 | 2,506,538,258 | 100% | ||
itsmikechu | 0 | 420,753,945 | 100% | ||
scipio | 0 | 111,483,135,018 | 100% | ||
greenorange | 0 | 609,471,115 | 100% | ||
physics.benjamin | 0 | 697,078,474 | 5% | ||
kenadis | 0 | 1,219,881,233 | 5% | ||
amavi | 0 | 780,859,306 | 1% | ||
gentleshaid | 0 | 1,199,026,586 | 5% | ||
dysfunctional | 0 | 241,031,977 | 2.5% | ||
vishalhkothari | 0 | 718,331,893 | 100% | ||
thinkingmind | 0 | 3,602,011,813 | 100% | ||
mathowl | 0 | 274,310,118 | 5% | ||
whileponderin | 0 | 2,682,370,316 | 100% | ||
hadji | 0 | 218,934,804 | 5% | ||
sakura1012 | 0 | 137,230,519 | 5% | ||
magpielover | 0 | 81,139,984 | 100% | ||
saunter-pl | 0 | 71,497,857 | 5% | ||
steem-hikers | 0 | 84,793,837 | 5% | ||
dexterdev | 0 | 854,413,556 | 5% | ||
ugonma | 0 | 65,226,089 | 5% | ||
mamicco | 0 | 1,420,121,318 | 100% | ||
builtinfire | 0 | 1,841,115,376 | 100% | ||
analyzer | 0 | 145,421,917 | 100% | ||
khairilakbar1 | 0 | 256,649,613 | 53% | ||
onderakcaalan | 0 | 3,818,257,937 | 100% | ||
wizzydayo | 0 | 612,887,897 | 100% | ||
chloroform | 0 | 297,443,274 | 5% | ||
panotwo | 0 | 613,799,954 | 100% | ||
clayjohn | 0 | 7,281,468,896 | 100% |
Hi! I will upvote and resteem your post to my 35,000+ followers if you reply to this comment. 👍🏻 [<b>a-0-0</b>](https://steemit.com/@a-0-0)
author | a-0-0 |
---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180428t194842510z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"links":["https://steemit.com/@a-0-0"],"app":"steemit/0.1"} |
created | 2018-04-28 19:48:39 |
last_update | 2018-04-28 19:48:39 |
depth | 1 |
children | 0 |
last_payout | 2018-05-05 19:48:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 139 |
author_reputation | -4,863,186,238,920 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,700,895 |
net_rshares | 0 |
*In my opinion your knowledge sharing work is really appreciable and i am not in developer field but in my opinion the new developers who are working towards the data protection, these session post is really helpful and this knowledge can bring some beneficial aspects in turn when implemented. Thanks for sharing and wishing you an great day. Stay blessed. 🙂*
author | chireerocks |
---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180428t195359337z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-04-28 19:54:03 |
last_update | 2018-04-28 19:54:03 |
depth | 1 |
children | 0 |
last_payout | 2018-05-05 19:54:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 360 |
author_reputation | 327,821,690,945,691 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,701,562 |
net_rshares | 0 |
Great series @scipio, there is always something to learn, beginners and pros alike. Matthias Reim, well, hahahaha. Thanks for setting the data back to my normal self ;) Keep up the brilliant work! Jan
author | jedigeiss |
---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180428t202155414z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"users":["scipio"],"app":"steemit/0.1"} |
created | 2018-04-28 20:21:54 |
last_update | 2018-04-28 20:21:54 |
depth | 1 |
children | 2 |
last_payout | 2018-05-05 20:21:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.666 HBD |
curator_payout_value | 0.011 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 200 |
author_reputation | 326,601,261,931,660 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,705,074 |
net_rshares | 107,521,805,347 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
scipio | 0 | 107,521,805,347 | 100% |
Well.... I really do think the slogan "Verdammt ich lieb dich" suits you right! :-) And... could you do a video of yourself performing better on the guitar than Matthias did? https://www.youtube.com/watch?v=Cox_VYZuT98
author | scipio |
---|---|
permlink | re-jedigeiss-re-scipio-learn-python-series-19-pymongo-part-2-20180428t202640877z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"image":["https://img.youtube.com/vi/Cox_VYZuT98/0.jpg"],"links":["https://www.youtube.com/watch?v=Cox_VYZuT98"],"app":"steemit/0.1"} |
created | 2018-04-28 20:26:39 |
last_update | 2018-04-28 20:26:51 |
depth | 2 |
children | 1 |
last_payout | 2018-05-05 20:26:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 219 |
author_reputation | 34,229,826,851,736 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,705,639 |
net_rshares | 0 |
author | scipio |
---|---|
permlink | re-scipio-re-jedigeiss-re-scipio-learn-python-series-19-pymongo-part-2-20180428t202800508z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-04-28 20:28:00 |
last_update | 2018-04-28 20:36:12 |
depth | 3 |
children | 0 |
last_payout | 2018-05-05 20:28:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 1.498 HBD |
curator_payout_value | 0.493 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 73 |
author_reputation | 34,229,826,851,736 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,705,808 |
net_rshares | 314,373,494,786 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
gentlebot | 0 | 202,333,095,375 | 15% | ||
scipio | 0 | 112,040,399,411 | 100% |
Dear@scipio sir, It's very helpful post for us. I shall follow you continue. Thank you very much for share a good post.
author | lover1 |
---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180429t052252236z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-04-29 05:22:57 |
last_update | 2018-04-29 05:22:57 |
depth | 1 |
children | 0 |
last_payout | 2018-05-06 05:22:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 119 |
author_reputation | 117,277,876,100 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,764,835 |
net_rshares | 436,012,356 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
lover1 | 0 | 436,012,356 | 100% |
another part two, i think its helpfull for programer. thanky you sir@scipio
author | moon-girl |
---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180428t195550875z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-04-28 19:55:57 |
last_update | 2018-04-28 19:55:57 |
depth | 1 |
children | 0 |
last_payout | 2018-05-05 19:55:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 75 |
author_reputation | 135,142,926,304 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,701,810 |
net_rshares | 0 |
Resteemit done .I always see your post..
author | mousumimou |
---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180428t195448196z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-04-28 19:54:48 |
last_update | 2018-04-28 19:54:48 |
depth | 1 |
children | 0 |
last_payout | 2018-05-05 19:54:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 40 |
author_reputation | 2,898,342,274,656 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,701,656 |
net_rshares | 0 |
The submission is reviewed and approved. Thank you for your contributions to open source community. I have a question for the update methods, how would we update many values in a subset of a document or documents in a collection, like as we would change the `reviewed` state of many posts in an account or accounts? Should we define a variable like `coll = db.accounts` , but for the subset of the accounts? Or is there a different syntax of `update_many()` to this? ---------------------------------------------------------------------- Need help? Write a ticket on https://support.utopian.io. Chat with us on [Discord](https://discord.gg/uTyJkNm). **[[utopian-moderator]](https://utopian.io/moderators)**
author | roj | ||||||
---|---|---|---|---|---|---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180428t215224219z | ||||||
category | utopian-io | ||||||
json_metadata | {"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"} | ||||||
created | 2018-04-28 21:52:24 | ||||||
last_update | 2018-04-28 21:52:24 | ||||||
depth | 1 | ||||||
children | 1 | ||||||
last_payout | 2018-05-05 21:52:24 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 2.082 HBD | ||||||
curator_payout_value | 0.000 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 712 | ||||||
author_reputation | 12,636,295,215,793 | ||||||
root_title | "Learn Python Series (#19) - PyMongo Part 2" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 52,715,236 | ||||||
net_rshares | 515,750,785,335 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
utopian.tip | 0 | 515,750,785,335 | 47.83% |
Hey @roj, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!
author | utopian.tip |
---|---|
permlink | re-re-scipio-learn-python-series-19-pymongo-part-2-20180428t215224219z-20180428t231616 |
category | utopian-io |
json_metadata | "" |
created | 2018-04-28 23:16:18 |
last_update | 2018-04-28 23:16:18 |
depth | 2 |
children | 0 |
last_payout | 2018-05-05 23:16:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 153 |
author_reputation | 238,310,597,885 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,723,875 |
net_rshares | 0 |
I think this is the best post, today I see, about python. You choose a great content for teaching us.
author | santoislam |
---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180429t091008077z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-04-29 09:10:06 |
last_update | 2018-04-29 09:10:06 |
depth | 1 |
children | 0 |
last_payout | 2018-05-06 09:10:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 103 |
author_reputation | 145,193,712,426 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,793,600 |
net_rshares | 1,222,292,403 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
santoislam | 0 | 611,285,063 | 100% | ||
dwancina | 0 | 611,007,340 | 100% |
Very nice tutorial. I've been recently using MongoBD more and more recently. Its nice to see a good little rundown on the technology especially with such a popular programming language.
author | tensor |
---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180429t033419122z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-04-29 03:34:18 |
last_update | 2018-04-29 03:34:18 |
depth | 1 |
children | 0 |
last_payout | 2018-05-06 03:34:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 187 |
author_reputation | 87,856,203,149,624 |
root_title | "Learn Python Series (#19) - PyMongo Part 2" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 52,752,151 |
net_rshares | 0 |
hello, @scipio I am dotnet programmer, Seems it will be easy for me to learn python. Actually your Presentation inspired me...
author | touhidalam69 | ||||||
---|---|---|---|---|---|---|---|
permlink | re-scipio-learn-python-series-19-pymongo-part-2-20180429t123604006z | ||||||
category | utopian-io | ||||||
json_metadata | {"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"} | ||||||
created | 2018-04-29 12:36:06 | ||||||
last_update | 2018-04-29 12:36:06 | ||||||
depth | 1 | ||||||
children | 0 | ||||||
last_payout | 2018-05-06 12:36:06 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 0.092 HBD | ||||||
curator_payout_value | 0.000 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 126 | ||||||
author_reputation | 2,409,777,621,558 | ||||||
root_title | "Learn Python Series (#19) - PyMongo Part 2" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 52,821,376 | ||||||
net_rshares | 23,195,441,048 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
dercoco | 0 | 10,209,777,029 | 61% | ||
veteran | 0 | 4,542,683,690 | 100% | ||
bitswami | 0 | 1,449,316,650 | 39% | ||
nelufareasmin | 0 | 6,690,319,772 | 100% | ||
tow-heed | 0 | 303,343,907 | 100% |