Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialGavin Schilling
37,904 PointsDifferent Mongo Response to "$or" Query
When I ran the exact $or command string exactly as Huston, Mongo returned "..." on the next line, but never finished or changed as first I thought it may have been a default sign of the database thinking or querying. Please explain. Thanks!
Neil McPartlin
14,662 PointsThank you Dennis Brown. Perfect explanation. If you were to add this again as an 'answer', I'd happily give you an upvote. And if Gavin Schilling likes it too, he might even give you a 'best answer' :)
Dennis Brown
28,742 PointsDennis Brown
28,742 PointsWhenever you see the "..." on the next line, it means that there is an open bracket or curly brace in the query. When using an operator like $or, an extra set of of brackets is needed to add an array of conditional expressions, with a set of braces around each expression, but if you leave one of these open at the end, Mongo Shell will interpret that as the query not being completed.
The reason this is even an option is so that you can create complex queries with multiple lines like so:
A good way to keep this issue from happening, is to always type the opposite bracket/brace with the first when typing out your queries; I am actually surprised that Mongo Hacker doesn't do this for you.