why don't I get anything returned from mongo with this jugglingdb query

70 Views Asked by At

I am using compoundjs with jugglingdb to get some data from Mongo. in my code I have the following

 Hotspot.all({ where : { fromid : imageMappingWidget.id } },
          function (err, hotspots) {
            console.log(hotspots);
        for (i in hotspots) {
          var hotspot = hotspots[i];
          hotspot.destroy();
          console.log("removed" + hotspot);
        };
      });

the console.log of hotspots outputs an empty array, and I of course never get in to the loop.

My imageMappingWidget object is

{ schema_version: 1,
  name: 'Testing 2',
  image: null,
  width: '3264',
  height: '2448',
  createDate: Sun Aug 24 2014 14:27:56 GMT+0200 (CEST),
  updateDate: Sun Aug 24 2014 14:27:56 GMT+0200 (CEST),
  uploadedImage: true,
  requiredWidth: null,
  id: 53f9da4c1ef48ced2a000001}

However if I do the following query from mongo on the command line

db.Hotspot.find({ fromid: "53f9da4c1ef48ced2a000001"})

I get exactly one record back.

1

There are 1 best solutions below

0
On

I thought, immediately after asking - why don't I just try to see if tostring on the id will help, and it did. grrrr.