Skip to content

Error resultsing from GET request: http://127.0.0.1:3000/db/collection/id #13

Closed
leejsinclair opened this Issue Apr 4, 2011 · 3 comments

2 participants

@leejsinclair

I might be coming from a position of ignorance as this is a second attempt as getting a nodejs project up and running. But is have followed the instructions provided within the README.md text file.

As far as i know i have jade, express and mongo npm packages installed. And within the folder /usr/local/lib/node/.npm/mongodb-rest/active/node_modules they all appear within their respective folders.

The service works fine expect when attempting to retrieve a specific record using the uri structure: http://127.0.0.1:3000/db/collection/id, in my case: http://127.0.0.1:3000/flockworks/agent/4d94aaadd23d5b010c000001. In which case the follow error occurs:

TypeError: undefined is not a function
at CALL_NON_FUNCTION_AS_CONSTRUCTOR (native)
at Object. (/usr/local/lib/node/.npm/mongodb-rest/0.6.7/package/lib/rest.js:22:21)
at param (/usr/local/lib/node/.npm/connect/1.2.1/package/lib/middleware/router.js:148:21)
at param (/usr/local/lib/node/.npm/connect/1.2.1/package/lib/middleware/router.js:159:15)
at param (/usr/local/lib/node/.npm/connect/1.2.1/package/lib/middleware/router.js:159:15)
at param (/usr/local/lib/node/.npm/connect/1.2.1/package/lib/middleware/router.js:159:15)
at pass (/usr/local/lib/node/.npm/connect/1.2.1/package/lib/middleware/router.js:164:10)
at Object.router as handle
at next (/usr/local/lib/node/.npm/connect/1.2.1/package/lib/http.js:204:15)
at Object.logger as handle

I have investigated the line error number:
query = {'_id': new mongo.ObjectID(req.params.id)};

The parameter req.params.id seems to be set.

Whereas sending a query URL request like '?query={"accountid":"myaccountID"}' works just fine.

i rolled back from node 0.5.0-pre to node 0.4.5 (node --version), as far as i can tell here are the .npm package versions:

  • connect@1.2.1
  • connect-mongodb@1.2.1
  • express@2.2.0
  • jade@0.1.3
  • mongodb@0.9.2
  • mongodb-rest@0.6.7

Platform Ubuntu 10.10

Any ideas?

@tdegrunt
Owner
tdegrunt commented Apr 4, 2011

Version bump, closed by a096343

@tdegrunt tdegrunt closed this Apr 4, 2011
@tdegrunt
Owner
tdegrunt commented Apr 4, 2011

Hi there,

Wouldn't worry about it, it's not you! It's just that node.js is moving quickly and I refuse to specify the exact versions of dependencies which is needed for which version of mongodb-rest, I just mention the minimum versions.

My code wasn't suitable for a later mongodb package, 0.6.8 should fix this.

Cheers,
Tom.

@leejsinclair

Thanks so much,

Upgrading to 0.6.8 worked.

Sounds like your on the bleeding edge, good work guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.