Changes for page How to Use Pymongo and Search for Data
Last modified by Leon Poon on 2021/03/23 13:17
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,17 +1,16 @@ 1 -First, [[set up a virtualenv>> doc:Computing Newbies.Python Newbies.How.WebHome]].1 +First, [[set up a virtualenv>>url:https://wiki.codepowered.com/wiki/How_to_Create_a_VirtualEnv]]. 2 2 3 -Make sure that your [[mongo server is running>> doc:Computing Newbies.How.WebHome]].3 +Make sure that your [[mongo server is running>>url:https://wiki.codepowered.com/wiki/How_to_connect_to_mongo_server]]. 4 4 5 -[[In the virtualenv, install pymongo>> doc:Computing Newbies.Python Newbies.How.WebHome]], then try out this .py file [[in the virtualenv>>doc:Main.How.WebHome]].5 +[[In the virtualenv, install pymongo>>url:https://wiki.codepowered.com/wiki/How_to_add_libraries_to_a_virtualenv]], then try out this .py file [[in the virtualenv>>url:https://wiki.codepowered.com/wiki/How_to_Run_a_Python_Script_in_a_VirtualEnv]]. 6 6 7 -{{code language="python"}} 8 -from pymongo import MongoClient 7 +{{{from pymongo import MongoClient 9 9 client = MongoClient() 10 10 db = client['test-database'] 11 11 collection = db['test-collection'] 12 12 print(collection.find_one({'my_key': 'some value'})) 13 - {{/code}}12 +}}} 14 14 15 -If you don't have data yet, you can [[store some>>doc :Main.How.WebHome]].14 +If you don't have data yet, you can [[store some>>url:https://wiki.codepowered.com/wiki/How_to_Use_Pymongo_to_Store_Data]]. 16 16 17 17 You can also follow [[tutorial>>url:https://api.mongodb.com/python/current/tutorial.html%7Cthis]].