A Simple Python Example Program for the MySQL Document Store
Last time we looked at a simple example program using the X Devapi and Node.JS. This time lets look at the Python version. Well, not actually the same. This time instead of looking for the Canadian record, the program limits the query to the first two records found. Besides Python 2.7, you will need to install the Google Protobuf code plus the development release of the Python Connector and a recent version of MySQL 5.7. The Code import mysqlx session = mysqlx.get_session({ # Authenticate to server 'host': 'localhost', 'port': 33060, 'user': 'dstokes', 'password': 'S3cR3t%'}) # Connect to Schema 'world_x' schema = session.get_schema('world_x'); # Set collection to 'countryinfo' collection = schema.get_collection('countryinfo') # Ask for two records result = collection.find().limit(2).execute() docs = result.fetch_all() # Print requested records for...