I have a db called db1, and a collection called places. If I do:
use db1;
use places;
db.places.find().pretty();
I get the proper results from the collection, but if I load the following javascript file, I do not get any results:
var query1 = function(){
db.places.find().pretty();
};
I'm loading the proper js file, from the correct directory with this command: load('test.js'); I'm actually running mongo in the same directory where the js file is. After loading it and calling the function query1(); I don't get any results. I'm running mongo shell version 2.6.3, Ubuntu 14.04 32 bit; I had a previous version on my old computer which had Ubuntu 12.04 and didn't have this issue when loading js files. Hope you can help me- Thanks!
return db.places.find().pretty();in query1?