Question: I know this question has been asked in various ways before but I've read them all and I can't get it to work with the below:

Here is a doc example:

```
"_id" : ObjectId("583659c5be5f0e6f70c95633"),
"firstName" : "da",
"lastName" : "ksk",
"email" : "papap@aol.com",
"surveyResults" : [
    {
        "mouseTracking" : [ ],
        "result" : "White",
        "question" : "What color website do you prefer?",
        "questionNumber" : "0"
    },
    {
        "mouseTracking" : [ ],
        "result" : "Laptop",
        "question" : "What device do you use most to browse the web?",
        "questionNumber" : "1"
    }]

```

Here is what I am trying to run in mongoose and having no luck:

```
db.results.update({_id:userIdVar, surveyResults: {$elemMatch: {questionNumber: questionNumVar}}},{$set:{"surveyResults.$.result" : newResultVar}});

```

I have variables being used and I know they have the proper values to match what is in the places I need to update. Is there something I am missing??

Answer: 
To be precise here, let's use Git's own [documentation on What a Branch Is](https://git-scm.com/book/en/v1/Git-Branching-What-a-Branch-Is):

> 
> A branch in Git is simply a lightweight movable pointer to one of these commits.
> 
> 
> 

A branch in Git is just a pointer to a commit. Typically, this commit will in turn be connected with other commits in a chain or branching chain structure. When we usually think of branches, we think of collections of commits logically ordered in some way, but technically speaking a branch is just a pointer to a commit.

Again, from the documentation on [Working with Remotes](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes):

> 
> Remote repositories are versions of your project that are hosted on the Internet or network somewhere
> 
> 
> 

The remote, which is really just short for remote repository, is a central place where branches and their commits are stored. The remote can also have branches, but typically you don't interact directly with these remote branches. Instead, there are local remote tracking branches, which, as their name implies, *track* the true state of the branches on the actual remote.
They are totally different concepts.

A remote is basically a location where a copy of the repository is stored. So for example you could have one remote in GitHub, another in BitBucket, another in Kelly's PC, etc.

A branch in your repository means that you have temporarily made some changes that you don't want to put into the main branch just yet because you aren't done with it (or for other reasons). They can be local, so that your remotes never see them, or you can push the branch to the remotes.