Databse mysql/mongodb

How can we run mysql queries from apigee cloud without BaaS ? as it is deprecated.

And is there any free db on cloud which is on sql or mongodb? so that I can use it for apigee cloud.

OR

how can we connect mongodb from apigee cloud?

http.createServer(function (req, res)

{ var MongoClient = require('mongodb');

var url = "mongodb://localhost:27017/demodb";

MongoClient.connect(url, function(err, db)

{ if (err) throw err; console.log("Database created!");

//db.close();

res.write("connected");

res.end(); }).listen(8080); });

I tried through this but it is not connected with localhost, how can we connect with any cloud db, if there is any cloud db on mongodb please share the link

Solved Solved
0 5 344
1 ACCEPTED SOLUTION

Hi @Samra Darakshan , use this mlab, which is a Database-as-a-Service for MongoDB.

https://mlab.com/

You can use the NodeJS to connect to this mLab.

You cannot use connect to locally running mongo/sql DB from Apigee cloud.

View solution in original post

5 REPLIES 5

Hi @Samra Darakshan , use this mlab, which is a Database-as-a-Service for MongoDB.

https://mlab.com/

You can use the NodeJS to connect to this mLab.

You cannot use connect to locally running mongo/sql DB from Apigee cloud.

Hi @Siddharth Barahalikar Thank you for the link, I have made the db on this 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.

shows this error, could you please tell me the mistake?

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

So how can we run our sql queries on apigee cloud without BaaS? yeah I have connected mysql with cloud database not with locally.

I am not sure why are you connecting SQL Queries and BaaS.

BaaS had a Select query simialr to SQL, but BaaS was not a SQL DB, it was a modified version of Usergrid(Cassandra internally).

what does your phrase "not with locally" mean?

You wrote "I have connected mysql with cloud database"

....and from what you wrote, that seems like your goal. So you've solved your problem. I don't understand what you mean by not with locally .