Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB query returns 3 dots instead of answer

I am following an online course on a website and when I am trying to submit a query on my local MongoDB, it returns ... instead of the answer.

The query I submit is

db.scores.find( { "type" : "essay", "score" : 50 }, { student : true, _id : false ).pretty()

like image 287
Yiannis Tsimalis Avatar asked Jan 23 '15 13:01

Yiannis Tsimalis


People also ask

What does three dots mean in MongoDB?

Three '.'s means your statement isn't complete... Most likely, you've missed a closing curly brace.

What does MongoDB query return?

By default, queries in MongoDB return all fields in matching documents. To limit the amount of data that MongoDB sends to applications, you can include a projection document to specify or restrict fields to return.

What is $GT in MongoDB?

Overview. $gt means “greater than.” It is a query operator and one of the comparison operators in MongoDB. It selects or matches documents with a path or field value greater than the specified value.

How does query work in MongoDB?

These queries are sent to the MongoDB server present in the Data Layer. Now, the MongoDB server receives the queries and passes the received queries to the storage engine. MongoDB server itself does not directly read or write the data to the files or disk or memory.


1 Answers

The "..." that I get as an "answer" from the local MongoDB server indicates that the server is expecting from me to provide it with more input.

I clearly have a syntax error on my query, I forgot to close a curly bracket.

The correct query db.scores.find( { "type" : "essay", "score" : 50 }, { student : true, _id : false } ).pretty() does not return "..."

HINT: In case the forgotten input is not in the end of the query, but somewhere in the middle (as happened in this query) you can escape the "..." mode by hitting the "enter" two times and then try to type in the new query again.

like image 63
Yiannis Tsimalis Avatar answered Sep 27 '22 20:09

Yiannis Tsimalis