I have a MongoDB server which have 1GB memory.
I have only one collection in the DB and it has almost 1300000 records and its size in disk is almost 1GB.
Now while I am running a query which returns one record like below:
db.collection.find({"customer.name":"Scott"})
Now there is a record for customer name = Scott. So this is working fine and returning record with few milliseconds.
Now if I run the same query with some other name which is not present in the collection, the Server is getting stopped.
I guess (I can be wrong though) this is because memory issue, DB is trying to search the whole collection and all the records are getting stored in memory and its getting crashed.
So My Question is: What is the actual problem and how to solve it?
*I don't want to increase the server memory.
*I use same volume data in another Mysql server which have only 500mb memory and it works perfect.
*I am running the Queries from direct commend line. Server has Ubuntu 14.4 OS