Basic Joins Error: Field must not begin with '$' or '.', field path was: $eq

I am working on the basic joins lecture and am coming across the following error:
Field must not begin with '$' or '.', field path was: $eq when building the aggregation in Compass.
Here is my code from the lookup stage: { from: 'comments', let: {'id': '_id’},
pipeline: [
{ ‘$match’: {
‘$expr’: {’$eq’: [’$movie_id’: ‘$$id’] } }
}
],
as: ‘movie_comments’
}
I stumbled across the Jira ticket as well and am wondering if this was ever resolved.

This
‘$expr’: {’$eq’: [’$movie_id’: ‘$$id’] } }
should be this:
‘$expr’: {’$eq’: [’$movie_id’, ‘$$id’] } }

Hopefully you can spot the difference.

2 Likes

You’re a life saver. I looked over this so many times and didn’t see anything, so I just completed the ticket and was at the the point that I thought it was a compass error. Once again, computer right, and I am wrong.

You’re welcome!
The error message from Compass is also unhelpful. It doesn’t tell you what line the error originates.