MongoDB Sample quiz / questions

  1. How does the value of _id get assigned to a document? (select all that apply)

_id field values are sequential integer values.

We can assign non ObjectId type value (numeric or text) when inserting a new document, as long as that value is unique to the collection.

It is automatically generated as an ObjectId type if not populated during the insert.

2. A query may include a_______ that specifies the fields from the matching documents to

return.

(select one correct answer)

projection                                                                lookup

union                                                                      selection

3. How is MongoDB Atlas related to MongoDB the Database? (select all that apply)

MongoDB Database has the same functionality as Atlas, but without the friendly user interface.

They both are MongoDB products.

Atlas has many tools and services within it that are built specifically for the MongoDB Database.

Atlas is a MongoDB service that can work with any database.

4. Which of the following is the most important consideration while designing the schema (data model) for MongoDB?

(select one correct answer)

The schema should be kept in 3NF similar to SQL schemas.

The schema should focus on creating possible embedded documents.

The schema should be modelled based on the data access and query patterns.

The schema should contain maximum indexes.

5. Select valid MongoDB documents from the given choices: (select all that apply)

A{ “_id”: 1,
“pet”: “cat”,
“name”: “Furball” ,
“fur”: “soft” }
B{ “_id”: 1,
“pet”: “cat”,
“name”: “Furball” ,
“attributes”: {
“coat”: “soft fur”,
“paws”: “cute” }
}
    C    { “_id”: “record1”} 
  • 6. In a MongoDB Document what is the role of fields and values? (select all that apply)

Values do not have to be attached to fields, and can be stand alone data points.

Each field has a value associated with it.

A field is a unique identifier for a specific datapoint.

  • 7. MongoDB scales horizontally using_______ for load balancing purpose.

(select one correct answer)

Oplog                                                                      Replication

Partitioning                                                              Sharding

  • 8. What does the following query do when performed on the posts collection? db.posts.update({_id:1},{$set:{Author:”Tom”}})

(select all that apply)

Sets the complete document with _id as 1 with the document specified in second parameter by replacing it completely

Updates the Author field as “Tom” for the document having _id as 1

Adds a new field Author if Author is not already present for the document

  • 9. What is the minimum sensible number of voting nodes to a replica set? (select one correct answer)

2                                                                             4

3                                                                             5

10. What is the MongoDB Database? (select all that apply)

The MongoDB database is an organized way to store and access data.

MongoDB database organizes documents in rows and columns.

MongoDB’s database uses tables of related data.

MongoDB is a NoSQL database that uses documents to store data in an organized way.

11. What is the maximum size of a MongoDB document? (select one correct answer)

64 KB                                                                      64 MB

2 MB                                                                       16 MB

12.Which type of indexes does MongoDB support? (select all that apply)

Compound Indexes                                                Multikey Indexes

Geospatial Indexes

13.Which of the following is true about Documents & Collections in MongoDB? (select one correct answer)

Collections are tables of documents and other collections.

Documents are made up of collections.

Collections consist of one or many documents.

Collections are documents that are organized in rows and columns.

14.MongoDB “replica sets” provide high________ _.

(select one correct answer)

scalability

performance                                                          

availability

all the above

15.By default, the _id field is included in the results of a query.

To suppress the id field from the result set, specify_______ in the projection.

(select one correct answer)

_id: 1                                                                       _id: -1

_id: 0                                                                       _id: null

Answer Key 
1.2. a3.4. c
5.6.7. d8.
9. c10.11. d12.
13. c14. d15. c 

CA11-U11RMS Restart utility parameters

CA11 is a utility from Computer Associates that helps to re-run a job multiple times and also to restart from abended steps, taking care of what files to be used when we rerun.

We need to specify a restart parameter that tells CA11 – how we want the job to be run. Valid parameters are nP, nR, nN and more (n = 0,1,2,3,..)

P for Production run (0P, 1P, 2P, .. nP)

  • The job will execute from the first step.
  • if any file with DISP=(NEW,*,*) already exist in catalogue, it will be deleted and re-created as defined in the current JCL job.

When we submit a job for first time, a parameter of ‘0P’ will be passed.
Due to any failure, if we need to run the job for a second time, and start from first step, pass a parameter ‘1P’.
If that fails again, and you need to run again from the beginning, use ‘2P’. (and so on…)
R for Restart/Rerun (1R, 2R, .. nR)

  •  the job will start from last abended step
  •  all the files, GDG file versions used in the last run of the job will be used
  •  After the failure of first ‘0P’ run, if we want to restart from the failed step, pass ‘1R’ as the parameter. Consecutive restart runs should have ‘2R’ ,’3R’, and so on..

N for Null (1N, 2N,.. nN)

  •  CA11 utility will not perform anything, and just allow your job to run.
  • but for every consecutive run, you need to change the number like 0N, 1N, 2N,.. etc

Note: if you do not change the number n in the parameter you will be getting a user abend U0060 saying that the parameter was not changes since the last run. However if your job has been completed successfully and you are rerunning the job, you do not need to change the number n.