Error: REDACTED is not defined :

Hi Everyone,

Can anybody help me on course chapter no 3, Lab this following query is showing error.

MongoDB Enterprise m103-repl:PRIMARY> use m201
switched to db m201
MongoDB Enterprise m103-repl:PRIMARY>
MongoDB Enterprise m103-repl:PRIMARY>
MongoDB Enterprise m103-repl:PRIMARY> show collections;
people
restaurants
MongoDB Enterprise m103-repl:PRIMARY>
MongoDB Enterprise m103-repl:PRIMARY>
MongoDB Enterprise m103-repl:PRIMARY> var exp = db.restaurants.explain(“executionStats”)
MongoDB Enterprise m103-repl:PRIMARY> exp.find({ “address.state”: “NY”, stars: { $gt: 3, $lt: 4 } }).sort({ name: 1 }).hint(REDACTED)
2019-08-25T10:46:35.131+0000 E QUERY [thread1] ReferenceError: REDACTED is not defined :
@(shell):1:1
MongoDB Enterprise m103-repl:PRIMARY>
MongoDB Enterprise m103-repl:PRIMARY>

Hey @DEBASISH_80204

REDACTED is a place holder for what you are suppose to fill out to complete the lab.

Redacted means to remove sensitive information. And in this case that info is the answer.

Please see this part of the instructions, and visit the documentation to find out what goes in the place of REDACTED

Note: The hint() method is used to force the query planner to select a particular index for a given query. You can learn more about hint by visitingits documentation.

Hey @natac13

Thanks for ack.

This document doesn’t contain any information for REDACT, it is very hard to understand as it confuses with (hint(REDACTED))

IF we are not getting any output …How in question we will guess the answer?

This question need some modification, So that people can understand it properly to answer.

Umm redact is just a placeholder for what you are suppose to replace with the answer

The docs lined are about .hint() which is what the lab is about

Although i got the answer, But you know the question is it self is very confusing as hint(REDACT) where as you saying redact is to remove sensitive information…How someone probably understand what index are passing through it, If that is the case it should contain which indexes are present in collection.

@DEBASISH_80204
IMHO I think the question is pretty clear.

In this lab you’re going to determine which index was used to satisfy a query given its explain output.
Given the redacted explain output above, select the index that was passed to hint.

With the last part saying to select the index that was used in the place of REDACT.

Glad you got the answer and hope this helps any future confusions.

@natac13… Yeah hopefully it will help for future aspect.