Locomotive or Mongoose not showing all data

89 views
Skip to first unread message

Nick McCready

unread,
Jul 6, 2012, 9:46:50 AM7/6/12
to locomo...@googlegroups.com
Forgive me if this is directed to the wrong group, but I am merely interfacing with a Locomotive / Mongoose instance for an ETL. Anyways I am approaching the end of it, but I having one major inconsistent problem. The problem is that Mongo is showing all the data that I transfered over which is 16192 rows /objects. However when I ask for a Locomotive GET on all objects for a specific repository / controller it is only returning a little more than half that amount. This is happening within in the browser and from requests in code. I have only had it successfully work at random when messing with logging settings.

At this point I am at a total loss and not sure where to go. FYI this is occurring on both Linux and OSX systems. I appreciate the help!

Nick McCready

unread,
Jul 6, 2012, 9:53:15 AM7/6/12
to locomo...@googlegroups.com
More info I forgot:

If I use a specific query instead of a request for all, I do receive all the data. So on get all it seems to be the problem. Here is the compiled JS below for getAll.

BaseRepository.prototype.getAll = function(callback) {
      var query;
      query = this.model.find();
      return callback(query.stream());
    };

from Coffeescript:
getAll: (callback) ->
query = @model.find()
callback query.stream()

Nick McCready

unread,
Jul 6, 2012, 10:21:52 AM7/6/12
to locomo...@googlegroups.com
Here is the exact same issue reported. Git Hub Mongoose

I am still reading through it.

James Wyse

unread,
Jul 7, 2012, 10:37:25 AM7/7/12
to locomo...@googlegroups.com
So it would seem you have a duplicate somewhere it's not permitted based on a unique index you have defined, and because of this bug it's not telling you about it and failing in this very strange way! Glad I didn't have to debug this one myself, whew!

Did you have any luck getting it working?

Nick McCready

unread,
Jul 7, 2012, 11:11:48 AM7/7/12
to locomo...@googlegroups.com
We do not think it is a duplicate. We modified the find function to return a very high amount 999999999 and then all objects are returned as they should be. Also queries by date do the same as well. It appears to be a race condition.

Nick McCready

unread,
Jul 7, 2012, 11:12:59 AM7/7/12
to locomo...@googlegroups.com

-    query = @model.find()

74
+    query = @model.find().limit(9999999)
Reply all
Reply to author
Forward
0 new messages