O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning Programmatic Access to MongoDB

Video Description

Design and code a reusable MongoDB class in Python and PHP and generate the necessary queries, filters, and projections for all CRUD operations, including sorting and pagination!

About This Video

  • Demonstrates, using PHP/Python, how to connect to a MongoDB instance, cluster, or shard using a user-account over TLS encryption.
  • Demonstrates basic CRUD queries via Python 3.6 and PyMongo.
  • Demonstrates basic CRUD queries via PHP 7.2 and the MongoDB PHP HVVM driver.

In Detail

MongoDB makes it possible to store and process large sets of data in ways that increase business value. The flexibility of unstructured, schema-less, storage, combined with robust querying and post-processing, makes MongoDB a compelling solution for enterprise big data needs.

In this product, we’ll demonstrate how to use two popular programming languages (Python, PHP) to connect to MongoDB databases and manipulate their contents via the use of the CRUD commands we covered in Program 2.

Instead of developing a basic application of limited functionality, we’re going to develop a MongoDB class that encapsulates all the CRUD functionality in methods. As a reusable class, you’re now free to incorporate your class into any application. Additionally, you can continue to add more functionality to your class, tailoring it to your precise requirements.

Taking this course will help you learn how to access MongoDB in both PHP 7.2 and Python 3.6 while still being able to execute CRUD commands in each language. You will also learn how to deal with exception handling for MongoDB API calls and add filters and projections to your queries. You will also populate your data structures with data fetched from MongoDB using cursors.

All the code and supporting files for this course are available at: https://github.com/PacktPublishing/Learning-Programmatic-Access-to-MongoDB

Downloading the example code for this course: You can download the example code files for all Packt video courses you have purchased from your account at http://www.PacktPub.com. If you purchased this course elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Chapter 1 : Installing the MongoDB API for PHP/Python
    1. The Course Overview 00:04:41
    2. Version of MongoDB 00:02:50
    3. Installing MongoDB 00:06:30
    4. Installing PHP 00:08:48
    5. Installing pyMongo 00:02:28
    6. Replication Reads and Writes 00:20:08
    7. IDE Setup 00:23:12
  2. Chapter 2 : Connecting to MongoDB via the PHP/Python API
    1. Introduction to PHP 00:11:58
    2. Connecting to PHP Instance 00:35:22
    3. Review and RBAC 00:09:01
    4. Connecting to Mongo Using RBAC 00:24:09
    5. Replication Set 00:14:56
    6. Connecting to Replication Set 00:23:14
    7. Read Preference 00:04:26
    8. MongoDB x509 00:09:17
    9. Mongo Server TLS 00:22:33
    10. Mongo TLS Client 00:14:21
    11. Connecting Programmatically to MongoDB 00:23:19
    12. Debugging Session to Connecting SSL to MongoDB in PHP 00:08:13
    13. GitLab Repository 00:07:11
  3. Chapter 3 : CRUD Queries to MongoDB via the PHP/Python API
    1. Introduction to CREATE 00:24:07
    2. Data Requirements for CREATE 00:10:40
    3. CREATE the User Record – Part 1 00:35:48
    4. CREATE the User Record – Part 2 00:34:13
    5. Fetching Records – Part 1 00:15:04
    6. Fetching Records – Part 2 00:41:37
    7. Fetching Records – Part 3 00:05:27
    8. Updating Records – Part 1 00:12:46
    9. Updating Records – Part 2 00:25:20
    10. Updating Records – Part 3 00:15:48
    11. Updating Records – Part 4 00:10:17
    12. Deleting Records – Part 1 00:08:28
    13. Deleting Records – Part 2 00:26:41
    14. pyCharm Setup 00:07:05
    15. Python – Connecting to MongoDB 00:36:05
    16. Python – Fixed TLS Issues 00:04:25
    17. Python – AppStack 00:06:29
    18. Insert New User – Part 1 00:29:52
    19. Insert New User – Part 2 00:23:11
  4. Chapter 4 : Advanced Queries
    1. Query Discriminants – Part 1 00:11:51
    2. Query Discriminants – Part 2 00:13:02
    3. Query Projections 00:16:43
    4. Sorting 00:13:35
    5. Skip/Limit 00:18:38
    6. Aggregate Queries 00:16:30