Week 3 L1 Flashcards

1
Q

What are aggregation methods ? Give some examples of what they do

A

The grouping of values from multiple records together to return computed results rather than raw data. For example results such as sum, average, maximum, minimum.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the three aggregation methods in MongoDB?

A

Single purpose aggregation operations(simple but very limited)
Aggregation pipelining (more efficient but limitations)
Map reduce programming - flexible but more complicated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What model works well across a cluster?

A

Distributed processing model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the two built-in mongo db operations that are single purpose aggregation ?

A

Count, Distinct(returns array of value with no duplicates)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a aggregation pipeline and what are its stages(not operations)

A
A sequence of stages/processes
Transform or reshape data
Filter Data
Group and sort data
Calculate data such as sum or average
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the aggregation operators used in a pipe line ?

A

Project, Match, Group, Sort, Limit , Unwind

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a field path and when are they used?

A

Field path used to access fields within documents in aggregate pipleine. prefixed by a dollar sign

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the three possible stages of map reduce programming

A

Map, reduce, finalise

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are they key features of the map function

A

No parameters and no return value
Called with every document in query result set
Accesses each doc via variable called “this”.
Produces a new document by calling emit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What must emitted docs be ?

A

Key: Value pairs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are they key features of the reduce function?

A

Function reduces the value array for each grouped key to a single object.
Calculation is on all of values in array ( for given key)
Can be simple like sum or something more complex such as finalize function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the parameters of the reduce function

A

Key and array of values from map function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does finalise function output

A

Outputs computation across the members of the value object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the parameters of the finalise function

A

Key and array of values from reduce function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the purpose of the query map reduce operation

A

To limit the documents processed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly