java call out/ mongodb connection / sql queries

1) why java call out policy is disable on apigee cloud?

2) how can we run sql queries on apigee cloud without using bass while retrieving our db from cloud?

3) I have made the db on this "https://mlab.com" cloud and connecting with apigee cloud using this " mongodb://<dbuser>:<dbpassword>@ds145573.mlab.com:45573/demodb " URL shows on mlab while substituting my db user name and password but its not connecting with apigee cloud.

var http = require('http');

http.createServer(function (req, res){ 
  var MongoClient = require('mongodb');
  var url = "mongodb:// : @ ds145573.mlab.com:45573/demodb";
  MongoClient.connect(url, function(err, db) { 
    if (err) throw err;
    db.close();
    res.write("connected");
    res.end();
  });
});

shows this error, could anyone please tell my mistake?

{"fault":{"faultstring":"Script node executed prematurely: Script index.js exited with status code 0","detail":{"errorcode":"scripts.node.runtime.ScriptExitedError"}}}
Solved Solved
1 2 482
1 ACCEPTED SOLUTION

Java & Python are blocked on Apigee Free Cloud accounts. You need to have a paid accoun to use those policies.

It is your lucky day, I worked on a PoC on mLab MongoDB and apigee cloud. PFA Proxy, you can deploy and make calls to it.

BTW before you do that, you need to install a Nodejs mongoose module.

I have used a mongoose module to connect with MongoDB.

mongodb-nodejs-rev1-2018-07-10-rev1-2018-10-30.zip

View solution in original post

2 REPLIES 2

Java & Python are blocked on Apigee Free Cloud accounts. You need to have a paid accoun to use those policies.

It is your lucky day, I worked on a PoC on mLab MongoDB and apigee cloud. PFA Proxy, you can deploy and make calls to it.

BTW before you do that, you need to install a Nodejs mongoose module.

I have used a mongoose module to connect with MongoDB.

mongodb-nodejs-rev1-2018-07-10-rev1-2018-10-30.zip

ok ok Thank you @Siddharth Barahalikar