Why object keys start with a dollar sign ($)

Tell us what’s happening:
I was looking at the provided code in the challenge and noticed that all the top level keys to of the object that is passed in to be create or updated in the database start with a dollar sign ($).
I was wondering why that is. Is that a convention? Has to do with mongodb? Just a preference…?
Thank in advance!

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 OPR/77.0.4054.60

Challenge: Implementation of Social Authentication III

Link to the challenge:

Hello there,

They are a MongoDB thing, and are known as operator indicators:

That specific lesson makes use of an update operator:

In a way, it is a MongoDB convention, but is in other DBs as well.

Hope this clarifies

Thanks that’s nice.
On a similar note: Don’t you think it would be good to just mention that very shortly in the challenge and link to documentation? It could help avoid a lot of confusion and guessing.

Nice point, and yes, I would most likely have done it.

However, there are a few things to keep in mind with the curriculum:

  • This far in the curriculum, I would expect Campers to know how to research code, and find out more about a specific tool like MongoDB - exactly as you have done :+1: . That is, in the real world, not every aspect of a piece of code can be/is explained, and the curriculum has largely been slowly letting go of Camper’s hands, as they progress.
  • People do not read - the less text, the better
  • We try as much as possible to not link to external pages within lessons, re- point 1, and it is another thing to maintain (make sure the link exists, and is pointing to the correct/relevant resource)

If you want, you can either:

  • Open a topic in #contributors to get more discussion about improving this lesson/section
  • Open a GitHub issue/PR for much the same

Keep in mind, we are spending most of our efforts on the new version of the curriculum, and do not typically make major changes to this version - what we are talking about is not necessarily a major change.

I agree with you. Asking and researching this issue taught me things I couldn’t have experienced if it was presented to me on a ready made plate.
Thanks again.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.