MongoDB Basics: Chapter 4: Advanced CRUD Operations - Query Operators: Logic


No Action
1
MongoDB Basics: Chapter 4: Advanced CRUD Operations - Query Operators: Logic

0 comment

21 December 2020, 7:03 am by antelove19

MongoDB Basics: Chapter 4: Advanced CRUD Operations - Query Operators: Logic
MongoDB Basics: Chapter 4: Advanced CRUD Operations - Query Operators: Logic

This lesson used the following commands: Connect to the Atlas cluster: ```javascript mongo "mongodb+srv://:@.mongodb.net/admin" ```
Switch to this database: ```javascript use sample_training ```
Find all documents where airplanes CR2 or A81 left or landed in the KZN airport: ```javascript db.routes.find({ "$and": [ { "$or" :[ { "dst_airport": "KZN" }, { "src_airport": "KZN" } ] }, { "$or" :[ { "airplane": "CR2" }, { "airplane": "A81" } ] } ]}).pretty() ```

Keywords:



Sources:

  1. university.mongodb.com