Web Application Development with JavaScript and MongoDB | Week 4

Graded Quiz

1. Which of the following documents will be returned with the following call to find? (select all that apply)

Documents.find({isPrivate:{$ne:false} })
{"title":"my doc 1", isPrivate:true}
{"title":"my doc 2", isPrivate:false}
{"title":"my doc 4",isPrivate: 10}
{"title":"my doc 3"}

2. Which is an appropriate folder to put .html files containing templates into?





3. If you see the following routing code, and you are running Meteor on your local machine, what will be printed out when the user accesses the URL http://localhost:3000/test ?

Router.route('/', function(){	
  console.log("case 1");
Router.route('/test', function(){	
  console.log("case 2");


case 2

case 1

case 1 and case 2

4. If you have a route that takes a parameter, such as the following:

Router.route("/documents/:_id", function(){ }) 

What is the correct code to print out the value of the _id parameter?


5. What database access rights do you have in the Meteor shell?

It depends if you are logged in.

Access to all data in collections defined in the Meteor app.

Access to data you are subscribed to.

Access to all published data.

6. Run the Meteor shell in the TextCircle application folder. Call find() and findOne() on the Documents collection. Which of the following are true? (select all that apply)

find() returns an array of objects.

findOne() returns a single object.

The first field of the object returned by findOne() is _id.

The first field of the object returned by find() is _mongo.

7. What is the purpose of the quickForm template?

To render a form as quickly as possible.

To automatically generate a form from a Schema.

To display a list of items from a Schema.

To reformat your HTML code.

* The material and content uploaded on this website are for general information and reference purposes only.

Please do it by your own first!

DMCA.com Protection Status

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
close button
Would love your thoughts, please comment.x