Exam Friday April 11. MongoDB Specifics Find() to Query db.collection.find(, ) db.collection.find{{select conditions}, {project columns}) Selection conditions:

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

CS179: GPU Programming Lecture 5: Memory. Today GPU Memory Overview CUDA Memory Syntax Tips and tricks for memory handling.
1 Query-by-Example (QBE). 2 v A “GUI” for expressing queries. –Based on the Domain Relational Calulus (DRC)! –Actually invented before GUIs. –Very convenient.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
C# Console Application
Instructor: Craig Duckett CASE, ORDER BY, GROUP BY, HAVING, Subqueries
Loops – While, Do, For Repetition Statements Introduction to Arrays
Logo Lesson 4 TBE Fall 2004 Farah Fisher. Prerequisites Create basic and complex shapes using Logo procedures Create Logo procedures that use variables.
JavaScript Switch Statement. Switch JavaScript Switch Statement If you have a lot of conditions, you can use a switch statement instead of an if…elseif…
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Read Lecturer.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Write Lecturer.
MS Access: Database Concepts Instructor: Vicki Weidler.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
INTERNET APPLICATION DEVELOPMENT For More visit:
The foreach LooptMyn1 The foreach Loop The foreach loop gives an easy way to iterate over arrays. foreach works only on arrays, and will issue an error.
NoSQL DBs.
Loops Doing the same thing over and over and over and over and over and over…
MongoDB An introduction. What is MongoDB? The name Mongo is derived from Humongous To say that MongoDB can handle a humongous amount of data Document.
Handling Lists F. Duveau 16/12/11 Chapter 9.2. Objectives of the session: Tools: Everything will be done with the Python interpreter in the Terminal Learning.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Aggregation.
Session 7 JavaScript/Jscript: Arrays Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
15/10/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
PHP MySQL Introduction. MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database.
Reporting in Version 5 Application Reports AKA: In Context or Right Click AKA: In Context or Right Click Export to Excel from Listing pages Management.
Searching and Sorting Chapter Sorting Arrays.
Session Title: Using SQL and PL/SQL for Queries and Reporting Presented By: Stephen Frederic Institution: IHL September 16, 2014.
The Banner HR User’s Guide to the Affirmative Action Summary Data Form, NZAAADC USNH HR November 2006.
MongoDB - Rockmongo - Overview - Query - Import, export - Execute/Command line.
Week 4 - Monday.  What did we talk about last time?  Queues  Implementing queues with circular arrays.
1 CS 430 Database Theory Winter 2005 Lecture 14: Additional SQL Topics.
AESuniversity Ad hoc Reporting Version 5. for the special purpose or end presently under consideration concerned or dealing with a specific subject, purpose,
WORKING WITH THE “CALL HTTP WEB SERVICE” WORKFLOW ACTIVITY Derek Nishino Nishino Consulting
NoSQL DBs. Positives of RDBMS Historical positives of RDBMS: – Can represent relationships in data – Easy to understand relational model/SQL – Disk oriented.
1/17/2016B.Ramamurthy1 Final Review CSE321 B.Ramamurthy.
Query Execution. Where are we? File organizations: sorted, hashed, heaps. Indexes: hash index, B+-tree Indexes can be clustered or not. Data can be stored.
JavaScript Arrays, Functions, and Forms George Mason University.
Extra Recitations Wednesday 19:40-22:30 FENS L055 (tomorrow!) Friday 13:40-16:30 FENS L063 Friday 17: :30 FENS L045 Friday 19:40-22:30 FENS G032.
Searching CSE 103 Lecture 20 Wednesday, October 16, 2002 prepared by Doug Hogan.
Query Execution Query compiler Execution engine Index/record mgr. Buffer manager Storage manager storage User/ Application Query update Query execution.
Aggregator  Performs aggregate calculations  Components of the Aggregator Transformation Aggregate expression Group by port Sorted Input option Aggregate.
Thinking in Sets and SQL Query Logical Processing.
SQL: Structured Query Language Instructor: Mohamed Eltabakh 1 Part II.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Learning Javascript From Mr Saem
1 Lecture 8 Shell Programming – Control Constructs COP 3353 Introduction to UNIX.
LESSON 8: INTRODUCTION TO ARRAYS. Lesson 8: Introduction To Arrays Objectives: Write programs that handle collections of similar items. Declare array.
1 float Data Type Data type that can hold numbers with decimal values – e.g. 3.14, 98.6 Floats can be used to represent many values: –Money (but see warning.
MS EXCEL PART 4.
Lecturer : Dr. Pavle Mogin
Instructor: Craig Duckett Lecture 09: Tuesday, April 25th, 2017
Lecturer : Dr. Pavle Mogin
javascript for your data
Aggregation Aggregations operations process data records and return computed results. Aggregation operations group values from multiple documents together,
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Final Review CSE321 B.Ramamurthy 11/23/2018 B.Ramamurthy.
Exam2 Review CSE113 B.Ramamurthy 12/4/2018 B.Ramamurthy.
Final Review CSE321 B.Ramamurthy 12/9/2018 B.Ramamurthy.
MongoDB Aggregations.
Web DB Programming: PHP
Arrays .
MongoDB Aggregations.
MongoDB Read/Write.
MongoDB Read/Write.
MongoDB Read/Write.
MongoDB Read.
Section 4 - Sorting/Functions
MongoDB Aggregations.
JavaScript: Introduction to Scripting
MongoDB Read Operations
Presentation transcript:

Exam Friday April 11

MongoDB Specifics

Find() to Query db.collection.find(, ) db.collection.find{{select conditions}, {project columns}) Selection conditions: To match the value of a field: db.collection.find({c1: 5}) Everything for select ops must be inside of { } Can use other comparators, e.g. $gt, $lt, $regex, etc. db.collection.find {c1: {$gt: 5}} If have more than one condition, need to connect with $and or $or and place inside brackets []

Find() to Query Projection: If want to specify a subset of columns – 1 to include, 0 to not include (_id:1 is default) – Cannot mix 1s and 0s, except for _id db.collection.find({Name: “Sue”}, {Name:1, Address:1, _id:0}) If you don’t have any select conditions, but want to specify a set of columns: db.collection.find({},{Name:1, Address:1, _id:0})

Cursor functions The result of a query (find() ) is a cursor object – Pointer to the documents in the collection Cursor function applies a function to the result of a query – E.g. limit(), etc. For example, can execute a find(…) followed by one of these cursor functions db.collection.find().limit() – Look at the documentation to see what functions

Cursors Can set a variable equal to a cursor, then use that variable in javascript var c = db.testData.find() Print the full result set by using a while loop to iterate over the c variable: while ( c.hasNext() ) printjson( c.next() )

Aggregation Three ways to perform aggregation – Single purpose – Pipeline – MapReduce

Single Purpose Aggregation Simple access to aggregation, lack capability of pipeline Operations, such as count, distinct, etc. db.collection.distinct(“custID”) Returns distinct custIDs

Pipeline Aggregation Modeled after data processing pipelines – Basic --filters that operate like queries – Operations to group and sort documents, arrays or arrays of documents $match, $group, $sum (etc.) Assume a collection with 3 field: CustID, status, amount db.collection.aggregate({$match: { status: “A”}}, {group: “CustID”, total: {$sum: “$amount”}}}

Sort Cursor sort, aggregation – If use cursor sort, can apply after a find( ) – If use aggregation db.collection.aggregate($sort: {sort_key}) Does the above when complete other ops in pipeline

FYI Case sensitive to field names, collection names, e.g. Title will not match title

What I hate about MongoDB I am confused by syntax – too many { }’s No error messages, or bad error messages – If I list a non-existent field, no message (because no schemas to check it with!) Official MongoDB lacking - not enough examples Lots of other websites about MongoDB, but mostly people posting question and I don’t trust answers people post

HW#7 Requires “massaging” the data, in order to bring it into MongoDB Will talk about it more on Wed.