Fully and completely deploying the FireRatingCloud support database on the cloud was much easier than expected.
Please refer to the fireratingdb node.js web server and FireRatingCloud Revit add-in GitHub repositories for an overview of the exploration and project evolution.
I already moved the database off-site to the mongolab host yesterday, but I still had the node web server running locally.
To do so, I created a new Heroku app and linked it to the existing fireratingdb GitHub repo.
I asked Heroku for the name fireratingdb
, and it was available, so my fireratingdb web server base URL now becomes http://fireratingdb.herokuapp.com.
Click on the link and see for yourself :-)
I modified the Revit add-in HTTP and REST API access information to use the global database server instead of the local one:
/// <summary> /// HTTP access constant to toggle between local and global server. /// </summary> public static bool UseLocalServer = false; // HTTP access constants. const string _base_url_local = "http://127.0.0.1:3001"; const string _base_url_global = "http://fireratingdb.herokuapp.com"; const string _api_version = "api/v1";
Recompiling and testing worked right away.
Since the mongo database is already hosted online on mogolab.com, you can see and edit the currently stored door instance documents at mongolab.com/databases/firerating/collections/doors.
Hmm.
Not much more to say, really.
All done.
Surprise, surprise.
Doing a bit more testing, I discover that the manipulation facilities provided by the mongolab web page are rather limited.
However, they clearly state that I can also use the standard mongo console, so I tried that right away.
It works fine and is easy:
$ mongo -u revit -p revit ds047742.mongolab.com:47742/firerating MongoDB shell version: 2.6.4 connecting to: ds047742.mongolab.com:47742/firerating rs-ds047742:PRIMARY> show dbs 2015-07-09T14:30:40.986+0200 listDatabases failed:{ "ok" : 0, "errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }", "code" : 13 } at src/mongo/shell/mongo.js:47 rs-ds047742:PRIMARY> use firerating switched to db firerating rs-ds047742:PRIMARY> show collections doors system.indexes rs-ds047742:PRIMARY> db.doors.find() { "_id" : "194b64e6-8132-4497-ae66-74904f7a7710-0004b28a", "project_id" : "qaSh_VLHTABQgzTeWedTLrOoriamVoTLY_BpjGwddhw=", "level" : "Level 1", "tag" : "1", "firerating" : 145, "__v" : 0 } . . . rs-ds047742:PRIMARY> db.doors.find({'firerating':123}) { "_id" : "2fc77d67-1af0-4a43-aa66-c544d411df04-000693d8", "project_id" : "SLBt0i_SDljQHp_vW25LvQMPFlWd3hdwCak8cEdyi6M=", "level" : "Level 2", "tag" : "204", "firerating" : 123, "__v" : 0 } rs-ds047742:PRIMARY>
Just to ensure all works fine with the whole cloud-based setup, with the server on Heroku and the database on Mongolab, I ran an update command on the mongo console, for example, by selecting all doors whose current fire rating value is 256, and raising it to 300:
rs-ds047742:PRIMARY> db.doors.find({'firerating':256}).forEach( ... function (u) { u.firerating = 300; db.doors.save(u); });
Launching the FireRatingCloud import command instantaneously updates the corresponding modified door properties.
The fireratingdb node.js mongo database web server and FireRatingCloud Revit add-in GitHub repositories provide an overview of the complete project analysis, exploration and implementation.
The current releases are 0.0.11 and 2016.0.0.7, respectively.