Issue with another Question in Practice Test

MongoDB University Team,
I find issue with another question in the Practice test on Collations. The question reads as follows:

Although, I agree with the answer here that “mongodb will throw an error”. But this is purely because the syntax of db.signs.find() that is used to specify the collation for the search is incorrect.

The find() below is syntactically incorrect.

db.signs.find(
** { “sign_text”: “Bonjour Québec” },**
** { “collation”: { “locale”: “en” } }**
)

If the above is replaced with the correct syntax of using collations with find(), as shown below, then the query should not fatal:

db.signs.find({ “sign_text”: “Bonjour Québec” }).collation({ “locale”: “en” })

So, I do agree that mongod will throw as error with the wrong syntax (as shown in screenshot below)

But the justification provided for the correct answer, does not seem right. Following is the justification that has been provided.

That explanation doesn’t sound right. My understanding is that we can always fire queries with one collation, when the collection is created with a different collation.

Can somebody from MongoDB University address this please?

Furthermore, the study guide specifies that you guys are not testing test-takers on the syntax. So if we were to ignore the syntax issue in the question, then the correct answer should have been "matching the documents using the locale “en” "

Further to my above post, following should prove that we can fire queries with one collation, while the collection is created with a different collation.

I have created a signs collection with collation of locale: fr and have created an index on it with collation of locale : es as shown below:

Have inserted 2 documents in this collection as below:

Below, I am able to find documents with collation having locale : en (which is neither the collation at collection level, nor the collation at the index level)

I hope this proves the point I am trying to make…

Thanks @PuneetC,

The information you provided is detailed. I will forward this to our team.

Thanks for notifying this. :slight_smile:

Kanika

@Kanika

awaiting a concrete confirmation on this please. Would want to know what is the response of your team?

Hi @PuneetC,

I have already communicated the same to the team and it will take some time to process the ticket.

Thanks for your patience. :slight_smile: I will update you once it gets completed.

Kanika

Hi @PuneetC,

Thank you so much for your analysis and detailed description. You were right, the answer or detailed description is incorrect and we are working on the same.

Again, thanks a lot for your effort! :slight_smile:

Kanika

1 Like