I am deploying / trying to understand a mongodb-rest project. When I run only the rest.jsscript, I get this error:
TypeError: Cannot read property 'ObjectID' of undefined
at app.post.connection.connect.res.status.json.message (/var/lib/openshift/5556b4c4fcf9336abf0000de/app-root/runtime/repo/server.js:99:32)
on this line when I try to process the message PUT:
var spec = {'_id': new BSON.ObjectID(req.params.id)};
I have the same include lines as rest.js
var mongodb = require("mongodb");
var BSON = mongodb.BSONPure;
but works on servers OpenShift.
Any idea what's wrong?
UPDATE
I tried using the same package:
var bson = require("bson");
var BSON = bson.BSONPure.BSON;
got the same error
János source
share