marcello3d/node-mongolian — Issue #86: collection.find() not firing/returning empty array on server
Author: ChristopherBiscardi
Created: 2012-01-29 18:33:43+00:00
State: open

var Mongolian = require('mongolian');
var ObjectId = require('mongolian').ObjectId;
var db = new Mongolian(); //db server information removed
var matches= db.collection('matches');
var user = '4f247fce78b1b3f47f00000a';

matches.find({uids:new ObjectId(user)})
.sort({score:1})
.limit(100)
.toArray(function (err, matchArr) {
console.log(matchArr);
});

This code works on my local computer. I can successfully connect to a remote database server and return an array of matches.
When I upload the same exact code to the app server, The connection to the database server is successful, however, the .find() doesn't fire.
In another case the the same find function returns an empty array on the server (The find() function works fine when running on my local computer with a remote database).

Am I missing something obvious here?